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

[Solved] Drag-n-Drop Between Nodes

0 Answers 93 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
mark
Top achievements
Rank 1
mark asked on 13 May 2011, 09:01 PM
I have a tree where nodes are either composites or leafs.  It should be possible to drag-n-drop any node onto a composite, but not a leaf.  While it is not possible to drop on a leaf, it is possible to rearrange leaf items by dropping between leafs.  For example, in the following tree, the user could rearrange the leafs in Composite2 by dropping Leaf2.d between Leaf2.a and Leaf2.b :

Composite1
    Leaf1.a
    Leaf1.b
    Composite1.2
         Leaf1.2.a
         Leaf1.2.b
Composite2
     Leaf2.a
     Leaf2.b
     Leaf2.c
     Leaf2.d

I am attempting to implement 'onNodeDragging' to let the user know when they are over a leaf and cannot drop the item.  While I can get the 't-denied' indicator displayed when over a leaf, it also displays when between leafs. It seems what I need is something similar to the 'e.dropPosition' (over/before/after) provided on the 'onNodeDropped', so I can be more precise on when to display the denied.

Thanks.
Tags
TreeView
Asked by
mark
Top achievements
Rank 1
Share this question
or