-
5 Jul 2010 8:01 AM #1
carousel in a tabpanel
carousel in a tabpanel
TabPanel and Carousel work on their own, but if I put a Carousel inside a TabPanel, the Carousel doesn't budge.Code:Ext.setup({ icon: 'icon.png', glossOnIcon: false, onReady: function() { new Ext.TabPanel({ fullscreen: true, tabBar: { dock: 'bottom', layout: { pack: 'center' } }, animation: 'fade', items: [{ title: 'Search', iconCls: 'search', cls: 'card card1', items: { xtype: 'carousel', items: [{ html: 'Card #1', cls: 'card card1', },{ html: 'Card #2', cls: 'card card2' },{ html: 'Card #3', cls: 'card card3' }] } },{ title: 'Other', html: '<p>Something else could go here...</p>', iconCls: 'info', cls: 'card card2' }] }); } });
Any suggestions?
-
5 Jul 2010 8:04 AM #2
Also, I keep seeing
in the examples. Are they necessary?Code:cls: 'card cardN'
-
6 Jul 2010 12:51 PM #3Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
Those classes are just to give the cards different colors.
The reason the Carousel doesnt work is because you are overnesting. If you want to add a carousel as an item of a Tabpanel, you can just add it to the TabPanels items array. The following will work:
If you want to wrap a panel around it, you would have to specify a layout of 'fit' on that wrapping panel to have the carousel take up all the available space.Code:Ext.setup({ icon: 'icon.png', glossOnIcon: false, onReady: function() { new Ext.TabPanel({ fullscreen: true, tabBar: { dock: 'bottom', layout: {pack: 'center'} }, animation: 'fade', items: [{ title: 'Search', iconCls: 'search', xtype: 'carousel', items: [{ html: 'Card #1', cls: 'card card1', },{ html: 'Card #2', cls: 'card card2' },{ html: 'Card #3', cls: 'card card3' }] }, { title: 'Other', html: '<p>Something else could go here...</p>', iconCls: 'info', cls: 'card card2' }] }); } });
-
6 Jul 2010 12:53 PM #4
Similar Threads
-
Carousel AutoPlay
By mobigeni in forum Sencha Touch 1.x: DiscussionReplies: 2Last Post: 6 Jul 2010, 12:45 PM -
[OPEN] [FIXED-110] Carousel indicator breaks down after changing carousel content.
By Mphasize in forum Sencha Touch 1.x: BugsReplies: 6Last Post: 1 Jul 2010, 11:41 AM -
[OPEN] [FIXED-19] Can't put a TabPanel inside a carousel
By rdougan in forum Sencha Touch 1.x: BugsReplies: 2Last Post: 3 Jun 2010, 1:54 AM -
Carousel
By doron447 in forum Ext: Q&AReplies: 8Last Post: 9 Jul 2009, 1:25 AM


Reply With Quote

