-
25 Oct 2011 12:11 PM #1
TabPanel problem
TabPanel problem
Hi,
I try to instanciate a custom tabpanel and get this error :
Here's the codeCode:Uncaught TypeError: Object [object Object] has no method 'getAnimation'
Custom tabpanel
the container of this tabpanelCode:Ext.define('app.view.MainTabPanel', { extend : 'Ext.tab.Panel', xtype : 'mainTabPanel', id : 'mainTabPanel', config : { layout : 'fit', ui : 'glossy', tabBarPosition : 'bottom', items : [ { title : '1', html : '1' }, { title : '2', html : '2' } ] } });
The mainview is called by the controllerCode:Ext.define('app.view.Main', { extend : 'Ext.Panel', requires : [ 'app.view.MainToolbar', 'app.view.MainTabPanel' ], config : { fullscreen : true, layout : 'fit', ui : 'glossy', tabBarPosition : 'bottom', items : [ { xtype : 'mainToolbar', docked : 'top' }, { xtype : 'mainTabPanel', } ] } });
anyone ?
-
31 Oct 2011 11:44 AM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,653
- Vote Rating
- 14
You wouldn't want to define an id of a class you are going to instantiate. The mainToolbar xtype is fine, but what is mainTabPanel?
-
11 Nov 2011 3:53 PM #3
jairok: I ran into this issue as well. Have a look at app/view/BottomTabs.js in the Kitchen Sink example for a working demo of Ext.tab.Panel.
Code:Ext.define('Kitchensink.view.BottomTabs', { extend: 'Ext.tab.Panel', config: { activeTab: 0, layout: { animation: { type: 'slide', duration: 250 } }, tabBar: { layout: { pack : 'center', align: 'center' }, docked: 'bottom', scrollable: { direction: 'horizontal', indicators: false } }, items: [ { title : 'About', html : '<p>Docking tabs to the bottom will automatically change their style. The tabs below are ui="light", though the standard type is dark. Badges (like the 4 below) can be added by setting <code>badgeText</code> when creating a tab/card or by using <code>setBadge()</code> on the tab later.</p>', iconCls : 'info', cls : 'card card1' }, { title : 'Favorites', html : 'Favorites Card', iconCls : 'favorites', cls : 'card card2', badgeText: '4' }, { title : 'Downloads', id : 'tab3', html : 'Downloads Card', badgeText: 'Text can go here too, but it will be cut off if it is too long.', cls : 'card card3', iconCls : 'download' }, { title : 'Settings', html : 'Settings Card', cls : 'card card4', iconCls : 'settings' }, { title : 'User', html : 'User Card', cls : 'card card5', iconCls : 'user' } ] } });
-
13 Nov 2011 5:23 AM #4
Hi,
today I figured out, that you get this error, if you instantiate a panel without items too (when you want to add some later)! So, you always have to specify at least one item... I think, this is a bug!?
Bye,
Alex
-
13 Nov 2011 4:18 PM #5
Ran into this also.
This is clearly a bug, worked fine on PR1.
Can't use PR2 because of this. breaks everything.
Need a patch badly.
-
13 Nov 2011 5:23 PM #6
You can replace (around l.54470 in debug-w-comments) :
with :Code:this.getLayout().getAnimation().setReverse(reverse);
But... Animation are still messed up (nothing to do with this try/catch), there is no more slide-back (right) animation... So sth else is broken.Code:try { this.getLayout().getAnimation().setReverse(reverse); } catch (e) { console.error('failed to getAnimation()'); }//@fix
-
14 Nov 2011 9:38 AM #7Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,653
- Vote Rating
- 14
I believe Carousel had a similar issue, we'll fix TabPanel.
-
14 Nov 2011 3:27 PM #8
-
14 Nov 2011 4:39 PM #9Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,653
- Vote Rating
- 14
I'll try to get you an override with this one as soon as I can.
-
14 Nov 2011 5:46 PM #10
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-1032
in
2.0.


Reply With Quote