Search code examples
extjsextjs4

How to hide tab in ExtJS 4


How to hide tab in ExtJS 4? Ext.getCmp("mytab").hide() doesn't work Can any one help me?


Solution

  • Read the documentation here: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.tab.Panel

    They give a specific example of how to hide tabs

    Extracted from link:

        var tabs = Ext.create('Ext.tab.Panel', {
        width: 400,
        height: 400,
        renderTo: document.body,
        items: [{
                title: 'Home',
                html: 'Home',
                itemId: 'home'
            }, {
                title: 'Users',
                html: 'Users',
                itemId: 'users',
                hidden: true
            }, {
                title: 'Tickets',
                html: 'Tickets',
                itemId: 'tickets'
            }]
     });
     setTimeout(function () {
        tabs.child('#home')
            .tab.hide();
        var users = tabs.child('#users');
        users.tab.show();
        tabs.setActiveTab(users);
     }, 1000);