andynuss
27 Jan 2010, 7:46 AM
Hi,
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.
Andy
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.
Andy