1. #1
    si-rus
    Guest

    Default How deactivate tab in TabPanel ?

    How deactivate tab in TabPanel ?


    How deactivate tab in TabPanel ?

    public method activate (String/Number id) - exists.
    where method deactivate ?

  2. #2
    Ext User
    Join Date
    Apr 2007
    Posts
    9
    Vote Rating
    0
    CurtisDuhn is on a distinguished road

      0  

    Default


    Activate means "switch to". When you activate a tab, you implicitly deactivate all other tabs.

    You may be looking for enableTab / disableTab.

  3. #3
    si-rus
    Guest

    Default


    I need in deactivating all tabs from script, not from user click.

  4. #4
    Sencha Premium Member
    Join Date
    Mar 2007
    Posts
    93
    Vote Rating
    14
    ismoore will become famous soon enough

      0  

    Default


    Quote Originally Posted by si-rus View Post
    How deactivate tab in TabPanel ?

    public method activate (String/Number id) - exists.
    where method deactivate ?
    I think you are missing something here. As there can only ever be one tab active, then by making a tab active, you are, in effect, deactivating the currently activated tab.
    Therefore you can only "deactivate" a tab by making another active.

    If you wish that a user can no longer make a certain tab active, you can disable that tab item (though again you will have to activate another tab first as the documentation seems to imply that the call to disable is ignored if actioned on the active tab).
    If you just want to move away from the tab that is currently active you will need to select another tab and use activate for that tab.

    You can probably see there is a good reason for not including a deactivate as ideally you need to determine which tab should subsequently be activated once this operation occurs.

    I don't believe there is the notion of "no active" tab, as they have similar functionality to radio buttons and true radio buttons imply that one is always pressed.

    Ian

  5. #5
    si-rus
    Guest

    Default


    Quote Originally Posted by ismoore View Post
    I don't believe there is the notion of "no active" tab, as they have similar functionality to radio buttons and true radio buttons imply that one is always pressed.
    But in an initial condition all tabs deactivated!
    How to reset a condition in a starting position?

  6. #6
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    You can't have a condition where all tabs are deactivated. By definition, one tab is always active.

  7. #7
    si-rus
    Guest

    Default




    I have 2 TabPanel: first - top, second - bottom.
    How to make so that at tab activation in one of TabPanel, in another TabPanel all tabs are deactivated?
    Really there is no decision?

    It's very important for me.

    Thanks

  8. #8
    Ext User DigitalSkyline's Avatar
    Join Date
    Apr 2007
    Location
    Rochester, MI
    Posts
    461
    Vote Rating
    1
    DigitalSkyline is on a distinguished road

      0  

    Default


    Maybe you need to try a different design as others have stated you can not have a tabpanel without at least 1 active tab in Ext. Perhaps a drop down menu would be more appropriate?

    I just came across this, maybe it's helpful?:
    http://extjs.com/forum/showthread.ph...ght=disableTab

  9. #9
    si-rus
    Guest

    Talking


    Hey gays,

    I'm found solve. Look at this.

    Code:
    <div id="tabs1" class="xp"></div>    
    
    <div id="tabs2" class="xp"></div>        
        
                
            <script type="text/javascript">
                var tabs1 = new Ext.TabPanel('tabs1');
                var tabs2 = new Ext.TabPanel('tabs2', {tabPosition:'bottom'});
    
                var funcDis1 = function (){  
                    if (tabs1.active != null) {
                      tabs1.active.hide();
                      tabs1.active = null;
                    }
                }
                var funcDis2 = function (){  
                    if (tabs2.active != null) {
                      tabs2.active.hide();
                      tabs2.active = null;
                    }
                }
    
                var tab = tabs1.addTab('01', '01'); 
                tab.on('activate', funcDis2);
                tab = tabs1.addTab('02', '02'); 
                tab.on('activate', funcDis2);
    
                tab = tabs2.addTab('03', '03'); 
                tab.on('activate', funcDis1);
                tab = tabs2.addTab('04', '04'); 
                tab.on('activate', funcDis1);
                
    
            </script>
    Thanks everybody.

  10. #10
    Sencha User fangzhouxing's Avatar
    Join Date
    Mar 2007
    Posts
    468
    Vote Rating
    2
    fangzhouxing is on a distinguished road

      0  

    Default


    hi, si-rus,
    what web graph framework do you use as following pic showed:

    http://www.qt-pro.net/datanasos/temp/disabletab.gif