I have 2 diagramA and diagramB
I am want my own key maker. so I set it to makeUniqueKeyFunction. like this.
diagramA.model.makeUniqueKeyFunction = UniqueKeyFunc;
diagramB.model.makeUniqueKeyFunction = UniqueKeyFunc;
when i drag node from A drop to B, first time makeUniqueKeyFunction don’t work. at the second time drag same node to B makeUniqueKeyFunction work and make new key for me.
then, I add
diagramB.addDiagramListener(“ExternalObjectsDropped”, function(e) {
e.subject.each(function (node) {
e.diagram.model.setKeyForNodeData(node.data, SV.minid());
});
});
it work fine, but I hit Ctrl+z to undo the Incremental Json is still old key to delete.
Here it ModelChangedListener.
diagramB.addModelChangedListener(function(evt) {
if (!evt.isTransactionFinished) return;
var json = evt.model.toIncrementalJson(evt);
console.log(json);
console.log("----------------------------------");
});
any suggestion ?
thanks.