-
12 Dec 2011 7:26 AM #1
[PR3] Carousel and dynamically created items
[PR3] Carousel and dynamically created items
Info:
- Version: Sencha Touch 2 PR3
- Browser: Chrome (but same on ipad and ipod)
- Description: I tried to add some items to carousel. Each item is created by Ext.create function as Ext.Panel, but with different html and cls. After creation all items share cls of first item. So it makes impossible to dynamically assign item class.
Code:Ext.define('component.MainX', { extend: 'Ext.Carousel', config: { width: 300, height: 200, scrollable: false, style: "background: #FFF", } });If there anything wrong with my understanding of this problem, please let me know.Code:var main = Ext.create('component.MainX'); Ext.Viewport.add(main); main.add([Ext.create('Ext.Panel', {html: "qwe",config: {cls: "abc"}}), Ext.create('Ext.Panel', {html: "asd", config: {cls: "def"}})]);
Regards
Adam
-
12 Dec 2011 9:57 AM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,652
- Vote Rating
- 14
Curious as to you you've added the cls under config here. If you were defining a new type of panel it would make sense that way.
-
13 Dec 2011 12:48 AM #3
If I pass cls outside config it doesn't affect panel classes at all - that was the way I did it using PR2. Main concept here is to define a clickable component with tap handling (in pasted example I'm using Panel, but it actually should be component extended with tap event), but with different classes (different background images). It should depend on data of known stucture but unkown content.
This duplicates another bug already reported in our system:
TOUCH-1237


Reply With Quote