Results 1 to 5 of 5

Thread: EXT 1.1Beta TabPanel.removeTab('tabId') does ! auto hide tabpanel when 1 panel active

  1. #1
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default EXT 1.1Beta TabPanel.removeTab('tabId') does ! auto hide tabpanel when 1 panel active

    http://extjs.com/forum/showthread.php?p=40374#post40374

    the clickable X is a 'closeClick function which is using the exact same public method removeTab but when called explicitly it does not behave the same way

    PHP Code:
        closeClick : function(e){
            var 
    = {};
            
    e.stopEvent();
            
    this.fireEvent("beforeclose"thiso);
            if(
    o.cancel !== true){
                
    this.tabPanel.removeTab(this.id);
            }
        }, 
    PHP Code:
        /**
         * Remove a TabPanelItem.
         * @param {String/Number} id The id or index of the TabPanelItem to remove.
         */
        
    removeTab : function(id){
            var 
    items this.items;
            var 
    tab items[id];
            if(!
    tab) return;
            var 
    index items.indexOf(tab);
            if(
    this.active == tab && items.length 1){
                var 
    newTab this.getNextAvailable(index);
                if(
    newTab)newTab.activate();
            }
            
    this.stripEl.dom.removeChild(tab.pnode.dom);
            if(
    tab.bodyEl.dom.parentNode == this.bodyEl.dom){ // if it was moved already prevent error
                
    this.bodyEl.dom.removeChild(tab.bodyEl.dom);
            }
            
    items.splice(index1);
            
    delete this.items[tab.id];
            
    tab.fireEvent("close"tab);
            
    tab.purgeListeners();
            
    this.autoSizeTabs();
        }, 

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956

    Default

    Can you explain what the problem is? I was unable to decipher from the other thread.
    Jack Slocum
    Sencha Co-Founder, Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum

  3. #3
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956

    Default

    Nevermind, the title has a description.

    Calling remove on the TabPanel is not the same as with the BorderLayout. The auto hide is provided by the BorderLayout so if you want that behavior you would need to call remove on the BL not the TabPanel.
    Jack Slocum
    Sencha Co-Founder, Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum

  4. #4
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    Quote Originally Posted by jack.slocum View Post
    Nevermind, the title has a description.

    Calling remove on the TabPanel is not the same as with the BorderLayout. The auto hide is provided by the BorderLayout so if you want that behavior you would need to call remove on the BL not the TabPanel.
    didn't consider that . duh me. So does the border layout add a before close event?

  5. #5
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    You are the man!!

    title is open by default, needs to be closed whenever a new panel is added.

    Awesome!
    PHP Code:
                  clearTitle: function() {
                    var 
    tabPanel layout.getRegion('center').getTabs()
                    
                    if (
    tabPanel.getTab('title') ) {
                        
    layout.beginUpdate();
                        
    layout.getRegion('center').remove('title');
                        
    layout.endUpdate();
                    }
               
                } 

Posting Permissions

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