View Full Version : Hidden tab panel shown after closing tab

2 Jul 2014, 6:08 AM
We have an application with several tabs. The first tab is always visible, and in a fixed position, and the others are all hidden. The hidden tabs can be shown by clicking on some buttons. When a tab is closed, that was previously hidden, then the panel of another hidden tab is presented and not one of the visible tabs. To prevent this behavior I added a listener to the close event and show the tab that I would like to be shown. This however doesn't work because the close event is being fired to soon so it doesn't have an effect on the tab that eventually will be shown. Shouldn't extjs take into account that tabs might be hidden and how can I solve this?

Gary Schlosberg
10 Jul 2014, 12:36 PM
Are you saying that upon closing a visible (but once hidden) tab, the tabpanel is displaying the content for a tab that is not currently visible? In which version of ExtJS are you seeing this issue?

10 Jul 2014, 11:00 PM
Yes that is what I meant to say. I'm seeing this behavior in version

I'm using an override to prevent this from happening:

Ext.override(Ext.tab.Bar, {
findNextActivatable: function(toClose) {
var me = this;
if (toClose.active && me.items.getCount() > 1) {
return (me.previousTab && me.previousTab !== toClose && !me.previousTab.disabled) ? me.previousTab : (toClose.next('tab[disabled=false][hidden=false]') || toClose.prev('tab[disabled=false][hidden=false]'));

Gary Schlosberg
30 Jul 2014, 5:50 PM
I'm not able to reproduce this issue. For me hidden tabs are not offered for display.

Perhaps you have a test case which exhibits the behavior?