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.
Unfortunately, activation email could not send to your email. Please try again.

Pushing entries to the historyManager

Thread ID:

Created:

Updated:

Platform:

Replies:

126971 Oct 19,2016 06:49 AM Oct 21,2016 08:09 AM JavaScript 3
loading
Tags: ejDiagram
Sander
Asked On October 19, 2016 06:49 AM

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?

Shyam G [Syncfusion]
Replied On October 20, 2016 09:15 AM

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 


Sander
Replied On October 20, 2016 09:25 AM

I'm currently working on version 14.3.49

Shyam G [Syncfusion]
Replied On October 21, 2016 08:09 AM

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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;