1. #1
    Sencha Premium Member
    Join Date
    Sep 2009
    Posts
    101
    Vote Rating
    1
    EZboy is on a distinguished road

      0  

    Default [4.1.0b2] BUG Ext.tab.Bar onClose jump to previous Tab not working

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


    Hi, there was an improvement added a while back here http://www.sencha.com/forum/showthre...s-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:

    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);    
        }
        
    });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    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
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member
    Join Date
    Sep 2009
    Posts
    101
    Vote Rating
    1
    EZboy is on a distinguished road

      0  

    Default


    Good to know, thanks for reply

Thread Participants: 1