1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    4
    Vote Rating
    0
    kmcanil is on a distinguished road

      0  

    Default Button required to switch between the tabs

    Button required to switch between the tabs


    HI,

    If my page contains more than 10 tabs then automatically a button should display on the left hand side.If the user clicks on that button then switching of the tabs should happen

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    Hi kmcanil,
    Try the Code given below:

    Code:
    Ext.create('Ext.panel.Panel', {
        title: 'Demo Panel',
        width: 400,
        id: 'mainPanel',
        height: 400,
        dockedItems: [{
            xtype: 'toolbar',
            dock: 'top',
            items: [{
                text: 'Next'
                , handler:function(){
                    var tabPanel = Ext.getCmp('mainPanel').getComponent(0)
                       ,activeTab = tabPanel.getActiveTab()
                       ,activeTabIndex = tabPanel.items.findIndex('id', activeTab.id);
                    if(activeTabIndex == tabPanel.items.length-1){
                         activeTabIndex =-1;                    
                    }
                    tabPanel.setActiveTab(activeTabIndex +1);
                }
            }]
        }],
        items:[
            {
                xtype:'tabpanel',
                items:
                [
                    {
                        title: 'Tab1'
                        , id: 'Tab1'
                    },
                    {
                        title: 'Tab2'
                        , id: 'Tab2'
                    },
                    {
                        title: 'Tab3'
                        , id: 'Tab3'
                    },
                    {
                        title: 'Tab4'
                        , id: 'Tab4'
                    },
                    {
                        title: 'Tab5'
                        , id: 'Tab5'
                    }
                ],
                listeners:{
                    afterrender:function(tabpanel){
                        var mainPanel = Ext.getCmp('mainPanel')
                           , toolbar = mainPanel.getDockedItems('toolbar[dock="top"]')[0];
                        if(tabpanel.items.length >4){  
                               toolbar.show();
                        }
                        else{
                            toolbar.hide();
                        }                    
                    }
                }
            }        
        ],
        renderTo: Ext.getBody()
    });
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi