PDA

View Full Version : HELP! How can I destroy a TreePanel or change the root node?



leezhou
18 Apr 2007, 7:38 PM
The question is :

1、I want destroy a TreePanel and rebuild a new one;

2、If can't do 1, I want change the root node in TreePanel then show a new tree;

In fact, there is no member function like destroy/remove/removeRoot/changeRoot in TreePanel.

So, how can I do it without memory leak (DOM/Event Listener etc.)

thanks

leezhou
19 Apr 2007, 6:52 AM
Maybe this question is so stupid,8-|

KimH
19 Apr 2007, 11:14 PM
You could search the forum for fx. "tree AND remove"... see this (http://www.extjs.com/forum/showthread.php?t=3049&highlight=tree+remove).

leezhou
20 Apr 2007, 5:04 AM
You could search the forum for fx. "tree AND remove"... see this (http://www.extjs.com/forum/showthread.php?t=3049&highlight=tree+remove).

Thankx

But, if remove dom only, listener and other attribute have attached will occur memroy leak in IE

see qooxdoo's source comment

tryanDLS
20 Apr 2007, 7:32 AM
You could manually remove (http://extjs.com/deploy/ext/docs/output/Ext.Element.html#removeAllListeners)the listeners before destroying the node.

hyankov
22 May 2007, 5:00 PM
I have exactly the same problem. And by the way, removing the listeners doesn't help the memory leak. I am losing 1.5 MB per tree refresh (meaning - remove the old tree and recreate it).