Yes, absolutely. Snippet parameter would open many, many doors. I hadn’t mentioned it because I figured it was on the ‘future’ list already.
If you could use the merge-template with it, it would be STUPENDOUS!
I see two methods, roughtly corresponding to a by-value parameter:
fooSnippet({{$Model.CaseModel.data.0.bar}})
This would obviously evaluate {{}} before passing that value as a parameter. Now if that passes an object instead of the value…
And a ‘by reference’ parameter:
fooSnippet('{{$Model.CaseModel.data.0.bar}}')
By reference is really a string, just need to be able to somehow ‘de-reference’ it in the snippet so it foo can update ‘bar’ easily. Not sure what that would look like. Still new to skuid and snippets/javascript.
But with this, I could have my stock routines as static resources and call them from many pages. My initial use case is for convenience buttons to increment a date field by xx number of days. (theres an action for that, but the ‘Next N Days’ is currently not working so you need snippets as a workaround.
…
Since JS is interperted (??), would it be possible to pass js code to a snippet as a parameter, that the snippet could run? Think similar to a sort routine where you pass a compare function. Getting off into the weeds a bit…