Hi,
I have a requirement like,
i should able to do drag an item in same level only.
i.e, i have to implement d nd d functionality in a way so that i can arrange the nodes in an order of my wish but in the same level.
in below tree i have to do arrange the order of two parent nodes like pnode2 first nd pnode1 last and node2,node3,node4 in an order node3,node2,node4 (But in SAME LEVEL).
But still i am unable to achive my thing with ur code.
Let me explain you what exactly i need…
The view of my tree like:
rootnode
parent1
child1
child2
child3
child4
child5
parent2
child6
child7
child9
child10
parent3
So i need to give an option to the user to arrange the nodes according to his wish.
but there is some conditions like
1.He can move the nodes in only one branch. i.e, he can move child3 to below child4, that is child4 comes first nd child3 second.
2.He can’t move child1 into the child2 branch. but he can move child1 to below of child2 so that the order will be child2 nd child1 then child5.
3.And he can change the order of parents also like parent1 comes after parent2. like wise
I think u understood the thing
I will wait for your reply.
Totally the thing is GIVING AN OPTION TO THE END USER TO CHANGE THE ORDER OF HIS TREE. but conditions apply
The view of my tree like:
rootnode
----parent1
--------child1
--------child2
------------child3
------------child4
--------child5
----parent2
--------child6
--------child7
------------child9
------------child10
----parent3
I have tried some thing like this
customTree.attachEvent(“onDragIn”, function(sId,tId,id,sObject,tObject){
var sParent = customTree.getParentId(sId);
var tParent = customTree.getParentId(tId);
return ((sParent==tParent) && customTree.hasChildren(tId) == “”);
});
Working fine but i am unable to move parents because parents can have children riaght so ((sParent==tParent) && customTree.hasChildren(tId) == “”) this will not work!
You need to use ‘complex’ dnd behaviour
But you need to redefine some things are described in this topic: viewtopic.php?f=3&t=30937
And the do the next: