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.

Copying ejTreeView exact contents to secodn ejTreeView

Thread ID:

Created:

Updated:

Platform:

Replies:

128307 Jan 12,2017 06:46 PM Jan 18,2017 07:20 AM JavaScript 1
loading
Tags: ejTreeView
Marc Call
Asked On January 12, 2017 06:46 PM

I am using an ejTreeView in my ASP.NET project.
I have 1 tree view that the user uses on one page, and then I want to display a second tree view with all the same data on the following page as a confirmation of what they had chosen on the 1st treeview.

How can I easily copy / duplicate my treeview with all its content and selections to a second treeview?

Piramanayagam Ramakrishnan [Syncfusion]
Replied On January 18, 2017 07:20 AM

Hi Marc, 
 
Thanks for contacting Syncfusion support. 
 
We have analyzed your query. We can achieve your requirement (“How can I easily copy / duplicate my treeview with all its content and selections to a second treeview”) in TreeView control by using getTreeData public method.  
 
This method is used to get updated data source after performing some operation such as drag and drop, node editing, adding and removing node from client side in TreeView. It will return the updated data source as JSON array object. Please refer the below code sample, 
 
[Script] 
 
var treeobj = $("#<%=Treeview.ClientID%>").data("ejTreeView"); 
var dataSource = treeobj.getTreeData(); 
var treedata = JSON.stringify({ sessionval: dataSource }); 
 
 
We can save this data source into session. We can retain this data source from session in another page and assign this data source to another TreeView. 
  
For more details on the getTreeData method, please refer to the help document link:
http://help.syncfusion.com/js/api/ejtreeview#methods:gettreedata 
 
For your reference, we have prepared a sample based on this, and it can be downloaded from the following location: Sample 
 
Please let us know whether the provided sample is helpful in achieving your requirement. If not, get back to us with more information to proceed further. 
 
Regards, 
Piramanayagam R

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.

;