View Full Version : Clear region?
nassaja-rus
21 May 2007, 8:32 AM
Is there any way to clear region (remove all it's panels and if i don't know them id's) for selected region on the fly?
jsakalos
21 May 2007, 8:38 AM
It should be possible. You can get TabPanel by layout.region('center').getTabs(). However, there is one thing too keep in mind. You should remove all event listeners before you will destroy the content of a tab.
tryanDLS
21 May 2007, 11:05 AM
You can use Region.remove() (http://extjs.com/deploy/ext/docs/output/Ext.LayoutRegion.html#remove) in a loop passing the index (or use the panels collection and the each fn to remove). Removing a panel calls panel.destroy, which takes care of removing the listeners.
nassaja-rus
22 May 2007, 12:14 PM
You can use Region.remove() (http://extjs.com/deploy/ext/docs/output/Ext.LayoutRegion.html#remove) in a loop passing the index (or use the panels collection and the each fn to remove). Removing a panel calls panel.destroy, which takes care of removing the listeners.
this dont work with center region (only with center):
main.layout.getRegion('center').panels.each(function(el){
main.layout.getRegion('center').remove(el);
},main);
prodce firefox exeption "was node not found, code 8"
jsakalos
22 May 2007, 6:52 PM
this dont work with center region (only with center):
main.layout.getRegion('center').panels.each(function(el){
main.layout.getRegion('center').remove(el);
},main);
prodce firefox exeption "was node not found, code 8"
I have read somewhere that you cannot remove (you must have) the center region. However, it should be possible to remove all tabs from center.
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.