I am trying to insert node by calling “addNodeData” method on existing Diagram.model. This is done within a transaction.
Please find jsFiddle for the same : http://jsfiddle.net/ankitarora1990/9vcooe5p/45/
function insertNode()
{
myDiagram.startTransaction(“Add Node”);
myDiagram.model.addNodeData({
key: myDiagram.model.nodeDataArray.length + 1,
text: “New Element”,
supers: [-2]
});
myDiagram.commitTransaction(“Add Node”);
}
This is my insertNode method which works fine and adds node in the model, but same is not reflected on canvas.
Things work fine if i don’t use customLayout i.e. Comment the line below in code
<span =“Apple-tab-span” style=“white-space:pre”> layout: goMake(CustomLayout),
Please let me know if i am missing something in the implementation.
My aim is to insert a new node while using Custom Layout.
Thanks and Regards
Ankit Arora