vtswingkid
21 Jan 2010, 7:40 PM
I haven't tested this for moving existing nodes.
But for new nodes inserting ends up appending the way it is.
I think if it already exists it would have a parentNode.
If it were new it wouldn't.
Recommened Fix in red:
insertBefore : function(node, refNode){
var newNode, exists;
if(!node.render){
node = this.getLoader().createNode(node);
}else{
//exists = !node.parentNode;
exists = Ext.isObject(node.parentNode);
}
newNode = Ext.tree.TreeNode.superclass.insertBefore.call(this, node, refNode);
if(newNode && refNode){
this.afterAdd(newNode, exists);
}
this.ui.updateExpandIcon();
return newNode;
}
But for new nodes inserting ends up appending the way it is.
I think if it already exists it would have a parentNode.
If it were new it wouldn't.
Recommened Fix in red:
insertBefore : function(node, refNode){
var newNode, exists;
if(!node.render){
node = this.getLoader().createNode(node);
}else{
//exists = !node.parentNode;
exists = Ext.isObject(node.parentNode);
}
newNode = Ext.tree.TreeNode.superclass.insertBefore.call(this, node, refNode);
if(newNode && refNode){
this.afterAdd(newNode, exists);
}
this.ui.updateExpandIcon();
return newNode;
}