Results 1 to 2 of 2

Thread: Problems with tabs & activate events

  1. #1
    Sencha User
    Join Date
    Feb 2013
    Vote Rating

    Default Problems with tabs & activate events


    I am completely new to extjs. I am trying to build an application, with about 30 controllers, which I try to keep tidy, so that I won't get lost. For this reason I try to cling to the guidelines (as far as i can understand all this stuff).

    The application contains several tabpanel for editing complex records. When the user opens the panel, the first tab should be displayed. Everytime a tab is activated, the information should be refreshed.

    I try to put all application logic into controllers. However, I encounter various problems with generating and receiving activate events on tabs.

    If I put a listener directly into the tabpanel definition:

    I get activate event for the first tab when the tabpanel is displayed and for each tab, when it is activated. However, at the beginning I get one superfluous event from another unknown object (the tabpanel itself?).

    I can read attributes of the given tab and thus distinguish among individual tabs.

    However, when I put the listener into the controller:

    1. Selector of type 'tabpanel tab[attr=value]' does not work. I have to use just 'tabpanel tab'.

    2. The listener is called with some weirdo objects, neither of which seems to be a tab (according to the documentation it should be tabpanel, tab) I have to use something like tab.up('xtype').getActiveTab() to get access to the tab and its attributes.

    3. The worst thing is that 'activate' event is not fired when the first tab is already active upon entering into the panel. I tried to fire activate event by hand, but It just not work. I tried the following:

    tabpanel.getActivePad().fireEvent('activate', tabpanel.getActivePad())

    without any success. I am just unable to fire the activate event.

    The activate event is supposed to carry out reloading the tab with fresh information. Is very hard to move the code outside the handler and call it from all entry points into the panel. I do need to get this working.

    What am I doing wrong? Or have I come accross a bug?

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    A selector of 'tabpanel tab' will get you the tab button not the tab item. Are you wanting the tab button (the item in the tab bar)?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2

    Think my support is good? Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts