PDA

View Full Version : Tabbar Panel with iframe



coooolmagic
7 Jul 2010, 3:17 AM
Hi all

can you please give me a very simple example where I have 2 tabs in 1 Tab panel and each tab opens an iframe.

I am little newbie in this and struggling to find some lead.

I am trying to use this existing example .... in this case it has static text displayed but i need to associate iframes to tabs...
var tabs = new Ext.TabPanel({
renderTo: 'tabs1',
width:450,
activeTab: 0,
frame:true,
defaults:{autoHeight: true},
items:[
{contentEl:'script', title: 'Short Text'},
{contentEl:'markup', title: 'Long Text'}
]
});

Condor
7 Jul 2010, 3:44 AM
You mean something like:

var tabs = new Ext.TabPanel({
renderTo: 'tabs1',
width: 450,
height: 450,
activeTab: 0,
items:[{
title: 'Tab 1',
bodyCfg: {tag: 'iframe', src: 'url1.html'}
},{
title: 'Tab 2',
bodyCfg: {tag: 'iframe', src: 'url2.html'}
}]
});
(you can't use autoHeight:true when using IFRAMEs)

coooolmagic
8 Jul 2010, 7:22 AM
thanks a lot . it worked!