1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    25
    Answers
    1
    Vote Rating
    0
    evilight is on a distinguished road

      0  

    Default Answered: Any sample for clickEvent of tabPanel

    Answered: Any sample for clickEvent of tabPanel


    Hi all,

    I wanna change the tabPanel's width by setSize({width: xxx}) when one of the tab is clicked.
    how can I catch this event?

    right now I have to change the ExtJS source code

    when define Ext.tab.Bar

    in the function :
    Code:
    onClick: function(e, target)
    before :
    Code:
    tabPanel.setActiveTab(tab.card);
    I add
    Code:
                        if( tab.card.width != undefined )
                        {
                          tabPanel.setSize({width:tab.card.width});
                        }
    I know this is not a right way to do so, but I really don't know how.
    Can someone give me some sample code for this?

  2. An Ext.tab.Panel supports event tabchange( Ext.tab.Panel tabPanel, Ext.Component newCard, Ext.Component oldCard, Object eOpts ).

    If you're using MVC architecture, register this event in a controller, via the init() method:

    Code:
    init : function() {
      this.control({
        'sometabpanel' : {                           
          tabchange: function(tabPanel, newTab, oldTab, eOpts)  {
            // you can examine some property of newTab, then determine what size to set.
            tabPanel.setSize(200, 400);
          }
        }
      });
    }
    If not using MVC, you can register the listener in-line, in the tabpanel config:

    Code:
    {
      xtype: 'tabpanel',
      listeners: {
        tabchange: function(tabPanel, newTab, oldTab, eOpts)  {
           tabPanel.setSize(200, 400);
        }
      },
      items: [{
        xtype: 'panel',
        title: 'Tab 1'
      }]
    }

  3. #2
    Sencha - Community Support Team friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106
    Vote Rating
    27
    friend has a spectacular aura about friend has a spectacular aura about

      0  

    Default


    An Ext.tab.Panel supports event tabchange( Ext.tab.Panel tabPanel, Ext.Component newCard, Ext.Component oldCard, Object eOpts ).

    If you're using MVC architecture, register this event in a controller, via the init() method:

    Code:
    init : function() {
      this.control({
        'sometabpanel' : {                           
          tabchange: function(tabPanel, newTab, oldTab, eOpts)  {
            // you can examine some property of newTab, then determine what size to set.
            tabPanel.setSize(200, 400);
          }
        }
      });
    }
    If not using MVC, you can register the listener in-line, in the tabpanel config:

    Code:
    {
      xtype: 'tabpanel',
      listeners: {
        tabchange: function(tabPanel, newTab, oldTab, eOpts)  {
           tabPanel.setSize(200, 400);
        }
      },
      items: [{
        xtype: 'panel',
        title: 'Tab 1'
      }]
    }

  4. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    25
    Answers
    1
    Vote Rating
    0
    evilight is on a distinguished road

      0  

    Default



    Thank you very much!
    I don't need to change Est JS 's source code Now !

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