-
16 May 2012 11:21 AM #1
Answered: TabPanel ActiveItem Error Msg
Answered: TabPanel ActiveItem Error Msg
Hi everbyody,
This is my case, I have a TabPanel, and when I try to load a view with the activeItem configured, it works fine, like this:
But, in my case, I have to put a listener and not use activeItem config, something like this:Code:documentoView = Ext.extend(Ext.TabPanel,{ fullscreen: true, activeItem: 1, items: [ { layout: 'fit', id : 'tab1', title: 'title 1', items: [formDoc] }, { layout: 'fit', id : 'tab2', title: 'title 2', items: [detalleTabPanel] }, { layout: 'fit', id : 'tab3', title: 'title 3', items: [planFactPanelPrincipal] }] });
And I get a error message:Code:listeners: { beforerender: function (thisComponent) { if(something){ thisComponent.setActiveItem('tab2'); } } }
What can I do?Code:Uncaught TypeError: Cannot call method 'addCls' of undefined
Thanks in advance!
-
Best Answer Posted by izak18
Thanks for the reply, my solution was put the setactiveitem in afterrender event, so the slide is ok, because in 'render' was not.
-
18 May 2012 6:35 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 435
- Answers
- 3102
Try passing an index or the actual component instance.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
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 services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
18 May 2012 7:59 AM #3
Thanks for the reply, my solution was put the setactiveitem in afterrender event, so the slide is ok, because in 'render' was not.


Reply With Quote