Hi,
I have a diagram that had been initialized with only one group. Now I call a function to add a child of that group by adding new data from Ajax response to nodeDataArray.
How can I check if new node are added to the diagram, in order to calculate some properties of old node ?
If you add some node data object to the model, you could just look for the Node in the Diagram:
myDiagram.startTransaction();
var newdata = { . . . };
myDiagram.model.addNodeData(newdata);
myDiagram.commitTransaction("node added");
var node = myDiagram.findNodeForData(newdata);
Presumably node
in this case will be non-null.
Remember that Diagram.findNodeForData and other similar methods assume that two model node data objects are the same only if they are the same reference (i.e. the same object in memory).