PDA

View Full Version : sencha touch equivalent of setActiveTab?



twine
30 Jul 2010, 9:02 AM
I'm trying to programatically flip a tab. For the example below, in ExtJS 3 has something like alphabet.setActiveTab(2) to flip to the "c" tab, but not sure how to do this with Sencha Touch. Looking in API docs, I see getActiveItem and getActiveTab, but no setter methods.

alphabet = new Ext.TabPanel({
activeItem: 0,
items:[{
id: 'a'
},{
id: 'b'
},{
id: 'c'
}
]
});

The differences between Sencha Touch and EXTJS are really inconvenient, the 0.9.1 ST release didn't even have Ext.pluck

meyerovb
30 Jul 2010, 6:06 PM
A tabpanel implements the card layout, and hence setActiveItem will flip tabs. If you want that function available then add a post to the feature request board.

evant
30 Jul 2010, 9:58 PM
Anything that has a card layout has a setCard method injected onto the container at runtime, I recently updated the docs to indicate as such.

So:



tabs.setCard(1);


In future, please use code tags on your code!