PDA

View Full Version : (resolved) Tree DnD "insert line" doesn't disappear over node



para
26 Jun 2007, 1:05 PM
When I drag a node from a tree to reorder it, everything (non-visual) works fine. However, when I drag over a node (as if to drop onto that node), the "insert-here" line doesn't go away.
The actions it is taking are correct, but visually it's annoying/slightly incorrect.
Attached are thumbnails depicting the issue.

Edit: It only happens when the node cannot be dropped on.

Narrowed it down to Line 116-136 of TreeDropZone.js.

jack.slocum
26 Jun 2007, 1:13 PM
If it can't be dropped on, then it's going to insert above or below. What exactly is the problem?

para
26 Jun 2007, 1:24 PM
I apologize. I forgot that I was using my own dropValidity function to allow/disallow dropping of nodes based on their type.
It still is a bug, but only for me. Sorry for the mistake.

para
26 Jun 2007, 1:33 PM
However, if anyone else does write a validity function (something to disallow dropping of tree nodes based on some criteria), then they may want this fix:



TreeDropNode - line 136:
else if( this.lastInsertClass == "x-tree-drag-insert-above" || this.lastInsertClass == "x-tree-drag-insert-below" || this.lastInsertClass == "x-tree-drag-append") {
Ext.fly(n.ddel).removeClass(this.lastInsertClass);
}