This is a migrated thread and some comments may be shown as answers.

Current Treeview Data bug?

1 Answer 78 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Thanos
Top achievements
Rank 1
Thanos asked on 09 Nov 2012, 02:49 PM
Hello,
I have been working with a treeview and a JSON file for the remote data source.
Of what I know the real time current data source of the tree can be accessed through:
$("#treeview").data("kendoTreeView").dataSource.data()
So I make some drag and drop changes but if the changes are made inside parent nodes then the current data doesn't change at all.
However if I drag and drop a node in the root node directory or outside of it,the current data seems to have the node copied in that position without deleting the initial one..

So the current data source seems to track only the changes made in the root node directory or outside of it,and even then the dragged nodes are copied and not moved.(even though visually they are moved through the drag ofcourse)

Is this a bug or am I doing something wrong here?

What I want is to modify the tree with drag and drops and then somehow save the progress so I can view the same modified tree even after refresh.
Is there any other way to do this?

1 Answer, 1 is accepted

Sort by
0
Thanos
Top achievements
Rank 1
answered on 12 Nov 2012, 09:31 AM
For others with the same problem,
The issue is solved in the latest beta: Kendo UI Beta v2012.3.1024

When the TreeView is created the datasource bind must be made like this:
tree = $("#treeview").kendoTreeView({
        dataSource :kendo.observableHierarchy(data),
        dragAndDrop:true
    }).data("kendoTreeView");
After wrapping the data array with kendo.observableHierarchy()  you can successfully extract the current data array through $("#treeview").data("kendoTreeView").dataSource.data() as mentioned above.

Many thanks to the Kendo UI team,keep up the great work out there!
Tags
TreeView
Asked by
Thanos
Top achievements
Rank 1
Answers by
Thanos
Top achievements
Rank 1
Share this question
or