View Full Version : [INFOREQ][3.1] tree drag drop doesnt allow "below" last expanded node

27 Jan 2010, 7:46 AM

I have a dragdrop enabled tree, and use isValidDropPoint to make sure that only sibling nodes are valid drop destinations for a source (reorder sibling function). Now lets say that I have just node1 and node2 which are siblings, and children of some parent, but no other children of that parent, both expanded to display their immediate children. There is absolutely no way to drag node1 to "below" node2. Extjs 3.1 thinks you are trying to drag into the children of node2, even if you slowly move the cursor to after the last child. In order to drag node1 below node2 I have to collapse node2. The reverse is not a problem.

var dragSource = data.node;
var dropTarget = nodeData.node;
var dragParent = dragSource.parentNode;
var dropParent = dropTarget.parentNode;
if (dragParent != dropParent)
return false;
if (dragSource.attributes.mytype != dropTarget.attributes.mytype)
return false;
if (pt == 'append')
return false;
return Ext.tree.TreeDropZone.prototype.isValidDropPoint.apply(this, arguments);

Note: in my tree, all nodes have a mytype defined, and nodes are siblings if mytype is the same.


Jamie Avins
27 Jan 2010, 8:10 AM
Can you provide a more complete example of this behavior?

27 Jan 2010, 4:07 PM
Sure thing. But you have to give me a couple days because I have to build an in memory tree and I have some meetings coming up.

Jamie Avins
27 Jan 2010, 4:10 PM
We keep INFOREQ open for at least a couple of weeks.

1 Dec 2010, 7:06 AM
I have this same problem, and also:

If you have node1 and node2, where node2 is a child of node1, it is impossible to drag/drop node2 so that it becomes a next sibling of node1. This only happens when node1 is the last node. I believe this should be allowed.

You can see this here :http://dev.sencha.com/deploy/dev/examples/tree/reorder.html
(try opening "widgets", and move an item below it -> no problem, but try opening "state", then you cannot move an item below "state".)

Is there a fix/solution for this?

6 Dec 2010, 10:39 AM
andynuss, if you want the dev team to try and fix something, you have to post a test case that demonstrates the bug. It's the bit of code that they can copy paste, run in their browser, reproduce the error with and fix if indeed broken.

6 Dec 2010, 11:00 AM
Hi, on second reading, andynuss is reporting exactly the same as I am, and the test case is what I described, look at the link I provided, because in the sample provided with the ExtJs package this error already occurs. Any help is highly apreciated.