View Full Version : What is best way to show a tabpanel?

30 Oct 2010, 11:55 AM
I have an that when first launched shows a Panel called mainPanel. When a user clicks on a list item, I want to load a details page which is a TabPanel called tabPanel.

Right now I do this by calling mainPanel.setCard(tabPanel, 'slide');

I may be overnesting, so what is the proper way to do this?

30 Oct 2010, 6:19 PM
Are you wanting mainPanel to have layout: "card" with a List as the first card and the TabPanel as the second?

30 Oct 2010, 7:43 PM
Yep, thats exactly what I need.

30 Oct 2010, 7:44 PM
Ok... so there ya go!

new Ext.Panel({
layout : "card",
items : [{
xtype : "tabpanel"

30 Oct 2010, 7:50 PM
Got it. Im working on consolidating everything like your code. Thanks for the quick response.

30 Oct 2010, 8:07 PM
Actually, I think I'm already following the same pattern. However, I declared my tabPanel as a var. Then I added it to the mainPanel's Items array. Is this the same?