I'm working on a functionality where a certain type of node cannot be dropped on another node. When catching this drop event I call the undo() method. This works fine in most cases, but when a node has been added to the diagram from the symbolPalette and is then dragged and dropped on the other node the undo() action causes the dropped node to be removed from the diagram.
I understand why this is happening, but to circumvent this I want to add a entry to the historyManager containing the initial position of the newly added node. How could I achieve this?
SGShyam G Syncfusion Team October 20, 2016 01:15 PM UTC
Please confirm us the Essential studio version that you are using at your end. So that we can provide a solution based on your version.
SASanderOctober 20, 2016 01:25 PM UTC
I'm currently working on version 14.3.49
SGShyam G Syncfusion Team October 21, 2016 12:09 PM UTC
Query:I understand why this is happening, but to circumvent this I want to add a entry to the historyManager containing the initial position of the newly added node. How could I achieve this?
You can use the client side method push of historyManager to achieve your requirement. We have created a sample in which we have added the custom entry to the historyManager in the dragEnter event. Also you can use undo method of historyManager to revert the custom action. Please refer to the help documentation and JSPlayground link below.