PDA

View Full Version : adding TabPanel to Layout



slavix
23 Aug 2007, 11:25 AM
Hello,
I can't seem to be able to get the TabPanel working... here is the code



var centerTabPanel = new Ext.TabPanel("center", {
resizeTabs:true,
minTabWidth: 20,
preferredTabWidth:150
});

var tab1 = centerTabPanel.addTab("center-tab-1", "Tab 1");
innerLayout.add('center', centerTabPanel);

this produces a panel.getid is not a function error. And if i change last line to

innerLayout.add('center', new Ext.ContentPanel("center"));

that works fine. What am I doing wrong? How can I add a TabPanel to a Layout Region?

thank you
Slava

jsakalos
25 Aug 2007, 3:18 PM
You don't need to create a TabPanel to get tabs in layout. Just add more then one ContentPanel to the same layout region. They are automatically converted to tabs.