Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you clear a tree in ExtJs?

I have managed to create an Ext.tree.TreePanel that loads child nodes dynamically, but I'm having a difficult time clearing the tree and loading it with new data. Can someone help me with the code to do this?

like image 649
slmcmahon Avatar asked Oct 11 '08 01:10

slmcmahon


1 Answers

From the wonderful blog of Saki an ExtJS guru.

while (node.firstChild) {
    node.removeChild(node.firstChild);
}

http://blog.extjs.eu/know-how/how-to-remove-all-children-of-a-tree-node/

like image 137
jDempster Avatar answered Sep 29 '22 11:09

jDempster