PDA

View Full Version : How to keep bottom tabbar in viewport while using setActiveItem from controller



won.rhee
8 Jul 2011, 2:28 PM
Hello All,

I am following Phonegap MVC design to create a simple application that has 2 view cards that will be rendered to viewport using setActiveItem method from controller.

My question is, I want to add a bottom tabbar with few icons in the viewport. So that this will be like a main navigation for the application.

Referencing the Phonegap code, I just cannot figure out how and where I should add this tabpanel.

I can change the Viewport to Ext.TabPanel from Ext.Panel, and add a bottom tabbar; however, since I am using setActiveItem method, viewport will not keep the bottom tabbar. Basically anything I've added from Viewport object will be gone since I am using setActiveItem.

I just cant seem to figure out a way to do this.....

mitchellsimoens
9 Jul 2011, 6:52 AM
Please do not double post. I have removed your duplicate post.

tomalex0
10 Jul 2011, 6:16 AM
Hi,

I think you are familiar with


this.application.viewport.setActiveItem(panelob,{slide:'left'});

this one we used to render new panels in to the viewport. In your case you want tabpanel to be static and still want cards to be navigated inside the tabpanel.

Try to setActiveItem for tabPanel rather than viewport

tabPanel.getComponent(0).setActiveItem(firstPanel,{slide:'left'});
tabPanel.getComponent(1).setActiveItem(secondPanel,{slide:'left'});