28 Feb 2013 2:21 PM #1
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:
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 Mar 2013 11:19 AM #2
- 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 @SenchaMitch
Sencha Inc, Senior Software Engineer
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. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services email@example.com
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.