I am trying to display treeData as it is showing in treeView hierarchy.
But the problem is order of node.
when I drag any node to different place, an actual treeData sequence does not change based on dragable node.
suppose I have 4 nodes in tree like below
1st node
2nd node
3rd node
4th node
when I drag 1st node after 3rd node, Tree looks like
2nd node
3rd node
1st node
4th node
but treeData remain in same order as
$scope.treeData = { id : '1', parent : '#', text : '1st node'},
{ id : '2', parent : '#', text : '2nd node'},
{ id : '3', parent : '#', text : '3rd node'},
{ id : '4', parent : '#', text : '4th node'}
so when I used ng-repeat to display treeData its remain in same order as
<ul>
<li ng-repeat="data in treeData">{{data.text}}<li>
</ul>
its give me
1st node
2nd node
3rd node
4th node
for this I tried start-dnd stop-dnd event to change the array index by using splice function of javascript, but I am fail to find the actual index of array and dragable index of array.
Let me know if there is any solution to achieve this.
Hi,
I am trying to display treeData as it is showing in treeView hierarchy. But the problem is order of node.
when I drag any node to different place, an actual treeData sequence does not change based on dragable node.
suppose I have 4 nodes in tree like below
when I drag 1st node after 3rd node, Tree looks like
but treeData remain in same order as
so when I used
ng-repeat
to display treeData its remain in same order asits give me
for this I tried start-dnd stop-dnd event to change the array index by using splice function of javascript, but I am fail to find the actual index of array and dragable index of array.
Let me know if there is any solution to achieve this.