[CLOSED] TabPanel hideTabStripItem/unhideTabStripItem

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] TabPanel hideTabStripItem/unhideTabStripItem

    Hi,

    In ext 1.x to hide a tab inside a tabpanel I do the following:

    tabPanel.hideTabStripItem(tab);
    What I have to use now?
    Last edited by Daniil; Jun 25, 2012 at 1:56 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please use:
    tab.tab.hide();
    The tab property represents an item within the TabPanel TabBar.
  3. #3
    Well, I'm adding tabs dynamically and I don't know how to use your code.

    When you say
    tab.tab.hide();
    I understand that, first 'tab' is tabPanel id, and the second 'tab' is tab id to close but I can't do it because tab id is dynamic.

    This is how I add tabs to the tabpanel, and in beforeclose event I control if tab is only hidden or closed.

    openTab: function (config) {
            if (Ext.isEmpty(config.url, false)) {
                return;
            }
    
            var tp = Ext.getCmp("tpMain");
            var tabId = MyNamespace.tabIdPrefix + MyNamespace.hashCode(config.url).toString();
            var tab = tp.getComponent(tabId);
    
            if (!tab) {
                tab = tp.add({
                    id: tabId,
                    title: config.title,
                    iconCls: config.icon || "icon-applicationdouble",
                    onBeforeCloseTab: config.onBeforeCloseTab ? config.onBeforeCloseTab : null,
                    anyDetailOpened: false,
                    closable: true,
                    closeAction: 'close',
                    loader: {
                        url: config.url,
                        renderer: 'frame',
                        noCache: true,
                        loadMask: {
                            showMask: true,
                            msg: 'Loading'
                        },
                        listeners: {
                            load: function (control) {
                                control.target.iframe.dom.contentWindow.parentTab = control.target;
                            }
                        }
                    }
                });
    
                tp.setActiveTab(tab);
    
                tab.addListener('activate', tab.syncSize);
    
                tab.on("beforeclose", function (tab, windowCloseRequest) {
                    var someCondition = true; //Dummy for this example
                    if(someCondition == true){
                        tab.closeRequest = true;
                        var tpMain = top.Ext.getCmp("tpMain");
    
                        /**** HERE IS THE PROBLEM TO HIDE TABS ***/
    
                        tab.hide();
                        tpMain.hideTabStripItem(tab);
    
                        var tabInicio = top.Ext.getCmp("tabInicio");
                        tpMain.setActiveTab(tabInicio);
    
                        return false;
                    }
                });
    
            } else {
                tab.closeRequest = false;
                tp.setActiveTab(tab);
                tab.fireEvent('activate');
                Ext.get(tab.tab.el).frame();
            }
        },
  4. #4
    Quote Originally Posted by softmachine2011 View Post
    the second 'tab' is tab id to close
    No, it is just the JavaScript property of the TabPanel tab which represents a respective item in the TabPanel tabBar. So, it would be same for all tabs.
    someTab.tab.hide();
    anotherTab.tab.hide();
  5. #5
    Ok, thanks again!
  6. #6
    Hi @Daniil,

    HideTabStripItem function is also in c#(Server side) in Ext 1.0. So what to use in Ext 2.0 for HideTabStripItem.

    Thanks
  7. #7
    Hi @yash.kapoor,

    You can use this code.
    this.Tab1.Call("tab.hide");
    Do not you need to hide a tab itself (i.e. its content)?
  8. #8
    I have a tabPanel and i want to use HideTabStripItem function is c# code

    TabPanel.HideTabStripItem(1);
    The above is the code. I ext 1.0 i am using it. But how can i used it in ext 2.0.

    Thanks
  9. #9
    There is the HideTab method. It will become available after the 2.1 release. The release should happen next week.
  10. #10
    Thanks alot Daniil......
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] Ext.Net's tabpanel and ExtJs tabpanel anchor
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 21, 2011, 11:57 AM
  2. Replies: 3
    Last Post: Aug 21, 2009, 2:24 PM
  3. Get TabPanel ActiveTab inside Other TabPanel.
    By grmontero in forum 1.x Help
    Replies: 1
    Last Post: Jul 16, 2009, 11:45 AM
  4. TabPanel.UnhideTabStripItem(tab) bug
    By Yauhen Papou in forum Bugs
    Replies: 0
    Last Post: Mar 08, 2009, 5:38 PM
  5. [CLOSED] Tabpanel in tabpanel from code behind
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 29, 2008, 7:56 AM

Tags for this Thread

Posting Permissions