Create a new sencha touch application with necessary files and modify the app.js file using following code. If you want to know about application structure, then follow my older post.
Ext.application({
name : 'carouselDemo',
requires : ['Ext.carousel.Carousel'],
launch : function() {
var horizontalCarouselItems = [];
for(var i=0;i<5;i++) {
var tempItems = [];
for(var j=0;j<10;j++) {
tempItems.push({
html : "<h3> Screen number: (" + i + "," + j + ") </h3>"
});
}
horizontalCarouselItems.push({
xtype : 'carousel',
direction : 'horizontal',
directionLock : true,
items : tempItems
});
}
Ext.Viewport.add({
fullscreen: true,
xtype : 'carousel',
direction : 'vertical',
items : horizontalCarouselItems
});
}
});
Comments