I was expected to used a two dimention carousel 'cos i have a tiny display (the web application if for an embedded device).
In fact, at the origin i was looking for tips for a user interface adapted for my qvga LCD . Then, i have think to the SONY devices that manage menu in two dimensions (http://u.speed.free.fr/uspeednews/do...r%20reseau.jpg) that's why i have tried to display one item a time trough carousel.
Then, i have start a two dimension caroussel (webapp.js) using sensa touch 2.0 :
var nbMaxMainScreen = 3;
var nbMaxSubScreen = 2;
var nbMaxSubScreenPerMainScreen = Array(3, 4, 3); // Number of sub item per screen
var mainScreen = new Array(nbMaxMainScreen);
var vcaroussel = new Array(nbMaxMainScreen);
var hcarousel;
function _objectIntrospection(obj)
{
var _propList = "";
for(var propName in obj)
if(typeof(obj[propName]) != "undefined")
_propList += (propName + ", ");
return _propList;
}
/* Link the vertical carousel with the horizontal one */
horizontalCarousel = Ext.Viewport.add(
{
xtype: 'carousel',
direction: 'horizontal',
cardSwitchAnimation: 'slide',
id: 'hcarouselID',
items: verticalCarousels
});
hcarousel = horizontalCarousel; // Save the handle to the horizontal carousel
horizontalCarousel.setActiveItem(1); // Enable the home panel by default
}
});
I have configure the default horizontal carousel with : horizontalCarousel.setActiveItem(1);
Now, i am looking for a way to change the vertical caroussel in javascript but i don't know how to get the verticalCarousel's handle where i can use setActiveItem(1).
Give the vertical carousel and id and then use Ext.getCmp('your-carousel-id') to get an instance of that carousel, which you can then call setActiveItem on.
Also, please use [code] tags in future.
Sencha Inc. Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.