We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Pushing entries to the historyManager

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?

3 Replies

SG Shyam G Syncfusion Team October 20, 2016 01:15 PM UTC

Hi Sander, 

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. 

Regards, 
Shyam G 



SA Sander October 20, 2016 01:25 PM UTC

I'm currently working on version 14.3.49


SG Shyam G Syncfusion Team October 21, 2016 12:09 PM UTC

Hi Sander, 
 
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. 
 
 
 
Regards, 
Shyam G 


Loader.
Live Chat Icon For mobile
Up arrow icon