-
28 Nov 2012 7:52 PM #1
Answered: Carousel within TabPanel
Answered: Carousel within TabPanel
Hi,
I am trying to embed a Carousel object within a TabPanel.
Here is the code I have now.
Viewport.js
Code:Ext.define("GCRUs.view.Viewport", { extend: 'Ext.TabPanel', config: { fullscreen: true, title: 'Gadget Covers R Us', tabBarPosition: 'bottom', defaults: { styleHtmlContent: true }, items: [ { title: 'Products', iconCls: 'star', xtype: 'productSelectPage' } ] } });
ProductSelect.js
Code:Ext.define('GCRUs.view.ProductSelect', { extend: 'Ext.Panel', requires: [ 'Ext.TitleBar', 'GCRUs.view.ProductCarousel' ], xtype: 'productSelectPage', config: { items: [ { xtype: 'titlebar', docked: 'top', title: 'Products' }, { xtype: 'productCarouselPage' } ] } });
ProductCarousel.js
Code:Ext.define('GCRUs.view.ProductCarousel', { extend: 'Ext.Carousel', xtype: 'productCarouselPage', config: { defaults: { styleHtmlContent: true }, items: [ { html : 'Item 1', style: 'background-color: #FF0000' }, { html : 'Item 2', style: 'background-color: #00FF00' } ] } });
Currently I see the TabPanel containing the products icon. And the Products Titlebar but nothing else.
Can you see what I am doing wrong?
Thanks
-
Best Answer Posted by mitchellsimoens
You are overnesting. The carousel does not need to be within a panel like you have it. The carousel can have the titlebar on it and be a direct child item of the tab panel and all will work.
-
30 Nov 2012 8:09 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 434
- Answers
- 3102
You are overnesting. The carousel does not need to be within a panel like you have it. The carousel can have the titlebar on it and be a direct child item of the tab panel and all will work.
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.
-
1 Dec 2012 3:58 AM #3


Reply With Quote