Provide context parameter to Conditional Rendering snippet returns true

Barry SchnellBarry Schnell 💎💎
edited June 25, 2020 in Ideas
Love the fact that Skuid has added the ability to call a snippet in conditional rendering!

Unfortunately, the current design does not provide any context to the snippet that is called.  While there are some use cases that just need to globally evaluate something, more often than not what needs to be evaluated in a free-form snippet pertains specifically to the data in context (e.g. table row action, etc.)

The "context" information is present in the code path that calls the snippet so would like to see this passed through to the snippet so it can be used duration evaluation.  Without this information, many of the use cases for this feature are unattainable.

Thank you!
7
7 votes

Under Consideration · Last Updated

Comments

  • edited June 25, 2020
    We're definitely not done on this one in terms of adding features. Context should be passed into the snippet. We also plan on letting you specify when the snippet should be re-evaluated.
  • Barry SchnellBarry Schnell 💎💎
    edited October 25, 2019
    Happy to hear there's more coming on this feature.  Waited a long time for this one, it's going to make so many things so much easier.  Thanks Ben!
  • Matt SonesMatt Sones 💎💎💎
    edited June 25, 2020
    Yes. Just discovered the lack of arguments on the rendering snippet. Looking forward to the update!
  • Pat VachonPat Vachon 💎💎💎
    edited October 25, 2019
    Yup. Just discovered this as well. :(
  • Pat VachonPat Vachon 💎💎💎
    edited October 25, 2019
    Voting for this and especially "We also plan on letting you specify when the snippet should be re-evaluated."
  • Pat VachonPat Vachon 💎💎💎
    edited June 25, 2020
    Still waiting on this no-brainer. Another client needs this now.
  • Craig RosenbaumCraig Rosenbaum ✭✭✭✭
    edited October 25, 2019
    I noticed rendering the element via skuid.$C('elementName').render() doesn't re-evaluate the snippet. Has anyone found a workaround for this?
  • Matt SonesMatt Sones 💎💎💎
    edited October 25, 2019
    Please do this soon, skuid!
  • Matt SonesMatt Sones 💎💎💎
    edited October 25, 2019
    Any update on this, Skuid?
  • John DahlbergJohn Dahlberg ✭✭✭✭
    edited October 25, 2019
    I'm curious as well.
  • John DahlbergJohn Dahlberg ✭✭✭✭
    edited October 25, 2019
    Here's a use case where this capability would be very handy.  We have a bunch of Skuid pages that are setup to mimic the related lists that you find on Salesforce record detail pages.  These are leveraged throughout our Skuid application in a similar fashion to native Salesforce.  On each of these list pages, there is a "New" button, which will open a popup that loads another page in a page include to create a new record.  It would be handy to hide that button if the user doesn't have access to create a record in order to prevent errors from occurring.  Here's the current code required to do this (which requires many snippets) and how this might look with a parameter capability:

    (Many Snippets)

    if(skuid.utils.getAPIDescribeSObject('Account') !== null)
        { 
            if( skuid.utils.getAPIDescribeSObject('Account').createable == 'true' ) 
            {
                return true;
            }
        }
    else{
        return false;
    }


    Here's how it might look with a parameter approach where the pagebuilder could pass in the arguments:

    (One Snippet) 

    var sObject = arguments[0];
    var permission = arguments[1];
    var condition = arguments[2];
    //other possible scenarios
    var field = arguments[3];
    var operation = arguments[4];

    if(skuid.utils.getAPIDescribeSObject(sObject) !== null)
        { 
            if( skuid.utils.getAPIDescribeSObject(sObject).permission == condition ) 
            {
                return true;
            }
        }
    else{
        return false;
    }
  • Pat VachonPat Vachon 💎💎💎
    edited June 25, 2020
    BUMP!!!
  • Pat VachonPat Vachon 💎💎💎
    edited June 25, 2020
    Bumpity Bumpity Bump!!!
  • Arne-Per HeurbergArne-Per Heurberg ✭✭✭✭
    edited July 17, 2019
    bump^2
  • Arne-Per HeurbergArne-Per Heurberg ✭✭✭✭
    edited June 11, 2020
    one more for luck!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!