Custom field renderer snippet in static resource not getting expected arguments.

So, here’s my field renderer I dropped in a static resource. You’ll notice that I’m expecting arguments such that I can set field = arguments[0] and value = arguments[1]. Instead, I’m just getting a field object for arguments.

What am I doing wrong here?

(as an aside, I’m using $r as a shortcut for skuid.snippet.registerSnippet)

“arguments” has special meaning in javascript. I would recommend against using “arguments” as a parameter name.  When you do that I believe it overrides the standard behavior of the arguments array.

$r('renderUserId', function (field,value) {<br>&nbsp;&nbsp;<br>});


and

$r('renderUserId', function () {<br>&nbsp; field = arguments[0];<br>&nbsp; value = arguments[1];<br>});


are exactly the same logically

Matt,

Try removing arguments from the function declaration:

$r('renderUserName',function() { ... });

Alternatively, specify the two arguments and then you don’t need the “var field = arguments[0], value =…” bit:

$r('renderUserName',function(field,value) { ... });

Sweet! Thanks, Ben and J.