GoJS: use more than one parameter in a transform function

I need to use two node properties in GoJS to perform a specific operation. Here is my current code:

$(go.Picture,
    {
        //some properties
    },
    new go.Binding("source", "item_status", getIcon)),
//....
function getIcon(item_status) {
    //do something
}

      

Is it possible to modify the above code so that the getIcon () function gets the second parameter item_id? For example, can I do something like this:

new go.Binding("source", "item_status","item_id", getIcon)),
....
 function getIcon(item_status, item_id) {}

      

thank

+3


source to share


1 answer


Answering my question again ...

to get all data for a specific node you can pass ""

instead "item_status"

to the binding function.



 go.Binding("source", "", getIcon)),
 ...
 getIcon(node){
     var x = node.item_status;
     var y = node.key;
 }

      

+4


source







All Articles