Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 6968

Link loose port binding when bound port id is changed

$
0
0

@Dominic.Lerbs wrote:

Hi,

when I use the following code to update the key and text

    diagram.startTransaction("update");
    var node1 = diagram.findNodeForKey(1);
    node1Data.itemArray[0].key = "ABC";
    node1Data.itemArray[0].text = "ABC";
    diagram.model.setDataProperty(node1Data, "itemArray", node1Data.itemArray);
    //node1.updateTargetBindings();
    diagram.model.removeArrayItem(node1Data.itemArray,2);
    diagram.commitTransaction("update");

then the key is updated. The text in data model is also updated, but the bound textbox shows still the old text.
image
image

When I add the command

    node1.updateTargetBindings();

then the text ist updated, but the link looses its port/panel/portId.
image

Is there a way to use model functions to update data. Or do I need to recreate the links by my own?

codepen

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6968

Trending Articles