PDA

View Full Version : remove child items in grouptab



kmil0cv
4 Nov 2009, 9:59 PM
Hi guys,
I'm new in Ext and i'm using the GroupTabs component (an extension) together with a viewport.

in my app,
when somebody clicks on any item on the left menu, Ext performs an Ajax Query to load his content (grids, windows, menu...),
my question is because any time that somebody clicks on a item, the DOM has growing, I prevent this using the activated listener for any item .

is something like this



np.menu.config =
{
mainItem: 0,
items:
[
{
title : 'Config',
id :'conf_item',
layout : 'fit',
style : 'padding: 5px;',
autoLoad: {
url : 'http://....',
scripts : true,
text :'loading module...'
},
listeners: {
activate : function(panel)
{
panel.removeAll();
panel.getUpdater().refresh();
}
}
},
{
title : 'Employes',
id :'us_item',
iconCls :'x-icon-employes',
layout : 'fit',
style : 'padding: 5px;',
autoLoad: {
url : 'http://...',
scripts : true,
text :'Loading module...'
},
listeners: {
activate : function(panel)
{
panel.removeAll();
panel.getUpdater().refresh();
}
}
}
]
}// eof config menu items
this apparently works, I see it on firebug, and the DOM has not growing up, but to.. I see some garbage
of others items.

How can I prevent this?? :-?
what could be a better solution to remove the childs components when somone clicks an Item ? :-?

is my solution good? :)

thanks guys! sorry for my bad english =)

cheers!