I have been struggling for a while now trying to sort this out. I have the following scenario:
If I add new nodes to the model data using diagram.model.addNodeData, my lines work perfectly.
However, I have a problem where I need to add the data to the model via a different route. If I do not disable “addNOdeData”, I end up with duplicates. So here is what I do:
- Create a new go.Node object.
- Set the node’s data property to the newly created object
- Add the node to the diagram using diagram.add
If I use this approach and I try to create a new link from other nodes to this new node, the link disappears, even though it is added to the diagram’s data.linkDataArray object. I am desperate to get this sorted out.
If anybody has any ideas or need more details, please let me know…