I have a list of tabs, what I want is whenever i switch a tab, the items are added to the tab and it is redrawn, and the old tab is destroyed. I'm doing this for performance reasons.
This is how i tried to do it, but its not working
view= Ext.Viewport.add({
xtype : 'tabpanel',
deferredRender:false,
tabBarPosition : 'bottom',
items : tabs,
listeners :
{
activeitemchange : function(container, newValue, oldValue,opts)
{
// --> destroy old tab
oldValue.setItems([]);
index = container.items.findIndex('id',newValue.id);
// --> redraw new tab
newValue.add(tabItems[index-1]);
}
}
});
The tabs are loaded only the first time. The second time i enter a tab i get
Uncaught Error: NOT_FOUND_ERR: DOM Exception 8
What is the proper way to do this ?
And is this really more performant than creating the tabs with their items in them.
Thank you