Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GoJS: use more than one parameter in a conversion function

I need to use two properties of a node in GoJS to perform a particular 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 getIcon() function gets a second parameter called item_id? E.g can i do something like this:

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

Thanks

like image 497
Notaras Avatar asked Mar 22 '26 09:03

Notaras


1 Answers

Answering my own question again...

to get all data for a particular node, you can pass "" instead of "item_status" to the Binding function.

 go.Binding("source", "", getIcon)),
 ...
 getIcon(node){
     var x = node.item_status;
     var y = node.key;
 }
like image 76
Notaras Avatar answered Mar 23 '26 22:03

Notaras



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!