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

Weird Behavior On Data Save

Hi,

Here is my treeview initially:



Then I go and add and item to the root: (and it can be aywhere, the point is a change is being made)



And it looks like this:


I renamed the last item to Item99, as it was named Item1.

Anyway, after I save the treeview data, here is what I get:



The treeview data is all over the place after an edit. It saves the data correctly only after the very first time the tree is built - when there is nothing but a root to begin with.

Here is how I save this data and the consequesnt updates:


 $("#btn").bind("click",
                function() {
                    var treeobj = $("#treeView").data("ejTreeView");
                    var jsonData = treeobj.getTreeData();
                    var dataToSend = JSON.stringify(jsonData);
                    -- ajaxCall
                });

The ajax call is not important, even when I look at the dataToSend variable, I see that the nodes and the updated data stringis all over the place. The server side is a simple, 'save this string to the database' one.

I want to capture the whole treeview source. Is there a method other than getTreeData()? So, what am I missing? 

Thank you for your help.



1 Reply

KR Karthik Ravichandran Syncfusion Team June 14, 2017 12:02 PM UTC

Hi Syntax, 
 
Thanks for contacting Syncfusion support. 
 
We have checked your query and not able to reproduce the reported issue in our side with the provided information.  
 
For your reference, we have attached the sample below to showcase treeview working properly in our side. 
 
 
If you still facing the same issue, please revert the sample based on your application to reproduce the issue in our end. This will help us to provide the solution at earliest. 
 
Regards, 
Karthik R 


Loader.
Live Chat Icon For mobile
Up arrow icon