PDA

View Full Version : [4.1.0b2] BUG Ext.tab.Bar onClose jump to previous Tab not working



EZboy
15 Feb 2012, 7:26 AM
Hi, there was an improvement added a while back here http://www.sencha.com/forum/showthread.php?139599-4.0.2a-Overwrite-Ext.tab.Bar-onClose-jump-to-previous-Tab&p=734587

but this does not seem to work.
How to repeat: use "Advances Tabs" example, add couple of closeable tabs using the button provided, close them one by one. Note: "Tab 1" will be active after every time you close another tab :(

As i outlined in the aforementioned thread, this can be fixed with this code:




Ext.override(Ext.tab.Bar, {


setActiveTab: function(tab) {
if (tab.disabled) {
return;
}
var me = this;
if (me.activeTab) {
//if( tab !== me.items.first() ) me.previousTab = me.activeTab; //changed here
me.activeTab.deactivate();
}
tab.activate();

me.activeTab = tab;
me.fireEvent('change', me, tab, tab.card);
},

onAdd: function(tab) {
var me = this;
me.previousTab = tab;//added here
tab.position = this.dock;
this.callParent(arguments);
},

onRemove: function(tab) {
var me = this;

if (tab === me.previousTab) {
//me.previousTab = null; //changed here
me.previousTab = me.items.last();//added here
}

if (tab === me.activeTab) {
me.activeTab = null;
}

if (me.items.getCount() === 0) {
me.activeTab = null;
}
me.callParent(arguments);
}

});

mitchellsimoens
15 Feb 2012, 7:32 AM
There is a bug filed a couple days ago by our QA team. Right now it is scheduled to be fixed in beta3 but this of course could get pushed back

EZboy
15 Feb 2012, 8:16 AM
Good to know, thanks for reply