@Dominic.Lerbs wrote:
Hi,
I'll try to explain my question through an example.
Let's assume I have the following nodeData entry:{ category: "defaultNode", name: "abc", parameters: [{ p1: "eee", p2: "fff" }, { p1: "ggg", p2: "hhh" }] }Now I need a binding with a conversion function to concatenate p1 of all parameters:
go.Binding("text", "parameters", (parameters: Array<any>, panel: go.Panel) => { let concat = ""; for (let parameter of parameters) { concat += parameter.p1; } return concat; }This works fine on initial display.
But how can I now update the p1 attribute in the node data so that the binding is updated automatically?
I tried it likemodel.setDataProperty(part.data.parameters[0], "p1", "ppp");but the binding doesn't get called. I assume the issue is that I am modifying an object in the array and not the array itself?Do I need to call part.updateTargetBindings("parameters") after updating the data or is there a better way?
Best regards,
Dominic
Posts: 3
Participants: 2