schoppet
9 Mar 2007, 4:38 AM
Hi,
I just tried to remove all childNodes from a TreeNode-Element, but I don't get it to work.
I have two functions:
fill : function(){
CAI.tree.getRootNode().appendChild(new Ext.tree.TreeNode({text:'Test'}));
},
del : function(){
var temp = CAI.tree.getRootNode().childNodes;
for(var i = 0, len = temp.length; i < len; i++) {
CAI.tree.getRootNode().removeChild(temp[i]);
}
}
The "fill"-function works as expected, but the "del"-function only removes some childNodes and then exits with the error-message "node has no properties [node.ui.remove()]"
After some more clicks on the "del"-function everything is removed, but I want it within one call.
Any hints?
Regards
Joerg
I just tried to remove all childNodes from a TreeNode-Element, but I don't get it to work.
I have two functions:
fill : function(){
CAI.tree.getRootNode().appendChild(new Ext.tree.TreeNode({text:'Test'}));
},
del : function(){
var temp = CAI.tree.getRootNode().childNodes;
for(var i = 0, len = temp.length; i < len; i++) {
CAI.tree.getRootNode().removeChild(temp[i]);
}
}
The "fill"-function works as expected, but the "del"-function only removes some childNodes and then exits with the error-message "node has no properties [node.ui.remove()]"
After some more clicks on the "del"-function everything is removed, but I want it within one call.
Any hints?
Regards
Joerg