PDA

View Full Version : Can you active a tab by clicking on an item in a carousel?



iphoneguy
30 Jan 2011, 9:08 AM
Hi,

I am used to hyperlinking and using URL links to move from one page to the next and I am still trying to discover how to use sencha style navigation. :-?

In my project the root panel is an Ext.TabPanel and each tab brings up a different carousel of items. I would like to be able to click on one of the items in a carousel and have it activate another tab in the tabbar. Does anyone know if this can be done? If so could you explain how? Any code of a working example would be greatly appreciated.

Thanks!

mitchellsimoens
30 Jan 2011, 12:00 PM
You can switch tabs programatically by doing a setActiveItem on the TabPanel

iphoneguy
30 Jan 2011, 1:26 PM
Thanks for the response mitchellsimoens. I'm sorry to say that I still don't quite understand how to do it. How do I get the setActiveItem function to connect to the items in the carousel?? That's the point where I'm lost. Is there a working example available or that you can provide so that I can see how I can set up the structure? I admit that I am learning sencha touch still and haven't completely grasped the syntax entirely. Below is the information that I discovered in the API docs about setActiveItem but I am still at a loss of how to apply it to my project. Can you explain how I could use this function to active a tab by providing some type of example for me to follow? :-/ Thanks a ton.


setActiveItem : function(card, animation) {
this.layout.setActiveItem(card, animation);
return this;
},