We have an application that uses different sets of tabs, depending on a selected tree node.
When the user activates a different tree node, all tabs are cleared and new ones are created. They may be the same as before, but can also be less or more tabs.
This is done by using the TabPanel.remove() function.
We would like to save the last active tab before a node switch and restore this tab afterwards, if it is contained in the new tab-set.
The idea is the following:
- on every "tabchange" we read the given tab-id and store it in a variable
- remove all tabs when user changes tree node
- build new ones and use setActiveTab() with the stored id
But now we are running into a problem:
When a tab is removed using TabPanel.remove(), it automatically activates the next visible tab which triggers the "tabchange"-event. This is bad because it also changes the stored active tab information.
When calling suspendEvents() before removal to prevent the problem, no tab is being removed (visually). Same result with purgeEvents() (worked in Ext 1.x) which seems like a bug to me.
Is this a bug that will be fixed in future or is there a better way to remove tabs without calling tabchange events ?
Thanks in advance.