Reputation: 2949
https://fiddle.sencha.com/#fiddle/1jih
Here is the link to a fiddle. Problem is that after tree is collapsed and then expanded, drag and drop stop working. I'm using Ext.dd.DragZone.
Steps to reproduce:
Upvotes: 1
Views: 570
Reputation: 20224
You are only adding the drag zones to tree nodes on startup. When nodes are collapsed and expanded again, their child nodes are destroyed and recreated. You should be able to add the drag zone again to all child nodes in the expand
event:
_addDDDragToNode = function (node) {
var me = this;
var treeView = node.getOwnerTree().getView();
me._addDDDragZone(treeView.getNode(node));
node.on('expand',_addDDDragToNode, me);
Ext.each(node.childNodes, function(el){
me._addDDDragToNode(el);
});
};
That this solution doesn't work seems to be a Sencha bug: A subcomponent (status proxy) of the dragzone is not destroyed when the dragzone is destroyed. I'm not completely sure how to circumvent that bug.
Upvotes: 1