PDA

View Full Version : Restrict drop on current parent tree but allow on other trees



swapnilsarwe
21 May 2008, 5:17 AM
I have two trees where I am dragging things from one tree to other tree.
Initially Tree 1 is filled with just one level childrens and Tree 2 is empty.


Tree1
-node1
-node2
-node3
-node4

Tree2
Now on tree1 I cant drop node under other nodes. I did that by setting them 'leaf'=>true.

Now I want to move the node from tree1 to tree2 and while on tree2 the node should change to 'leaf'=>false.


Tree1

Tree2
-node1
-node2
-node4
-node3
And the above structure should be possible to make on tree2.

When I analyzed this situation, I think job should be simpler by changing the property on the fly when node is dropped on another tree and not on parent tree.
I think I should be getting the solution by tomorrow with some RnD, but want to know has anybody went through this situation and have tried any solution.
Also if there is any thread with same problem please guide me to it. I tried searching it but did not find it.

Regards,
Swapnil.