Code in this post can be obsolete, however, principles and theory may still apply.
node
:
while(node.firstChild) { node.removeChild(node.firstChild); }
That’s all there is to it
I'm a well seasoned developer, consultant and educator of web applications based mainly on Sencha libraries, PHP, MySQL and Node.js. Besides (Apple) computers, I love photography and mountain biking.
Follow me:
Latest posts by saki (see all)
- Ext, Angular, React, and Vue - 27. June 2019
- The Site Resurgence - 11. February 2018
- Configuring ViewModel Hierarchy - 19. June 2015
14 Responses
When i remove all children the icon of folder change, how can i do to avoid this?
thankyou!!!!!!!
use without the backslash in the getCmp
Ext.getCmp(‘treeid’).getRootNode().removeAll();
Thanks mate, saved my day…
— Anish Sneh
Hi, I am trying to remove the nodes like in your example and than add them again. Firstly I have a memory leak after that, and also sometimes i have an awfull “this.target is null
error source line: [Break on this error] Ext.ToolTip=Ext.extend(Ext.Tip,{showDe…ithin(this.target.dom,true)){return;}” error );
Just to bring to ppls attention, there’s a new removeAll method on the tree node. Looks like its only in version 3.2 and not 3.1 (worked that out the hard way). removeChild also doesn’t work in 3.1 but fixed in 3.2.
This works, thanks. Love your site!
Very interesting and informative site! Good job done by you guys, Thanks
while(node.firstChild && node.firstChild.remove());
Awesome, really helped me, thanks!
Nice! I was looking for this, thanks.
No, I haven’t made Ext WordPress theme.
are you the maker of the extjs wordpress template?
i like it and i see the features of 2.0?
is this still under development??
greets