Results 1 to 3 of 3

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

  1. #1
    Sencha Premium Member
    Join Date
    Sep 2009
    Posts
    101
    Vote Rating
    1
      0  

    Default [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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha Premium Member
    Join Date
    Sep 2009
    Posts
    101
    Vote Rating
    1
      0  

    Default

    Good to know, thanks for reply

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •