We’ve a functionality of copying and pasting a subtree in our tree module. The implementation is done using JavaScript.
While copying, we are gathering the selected node’s child items and storing in a Set.
Then we are copying to the clipboard using
var subTreeItems = _fetchSubTree(); // copying all the children of selected node
this.diagram.commandHandler.copyToClipboard(subTreeItems);
var copiedItems= this.diagram.copyParts(subTreeItems , null, false);
This copiedItems we are using while pasting.
When we used GoJs 1.8, the node’s .data object coming of type ctor
but after updating the library to 2.x, the node’s .data object coming with the type constructor
This is breaking our paste functionality.
Is there any way to get the data as ctor type.
While debugging the source, found below block which is reassigning the data object with the constructor type.