PDA

View Full Version : how show iframe within tab



shuang
26 Apr 2008, 10:46 PM
i'm need add iframe into my 'TabPanel'

now , i'm loaded file 'miframe.js'

my tab

Ext.onReady(function(){

// basic tabs 1, built from existing content
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'}
]
});

// second tabs built from JS
var tabs2 = new Ext.TabPanel({
renderTo: document.body,
activeTab: 0,
width:600,
height:250,
plain:true,
defaults:{autoScroll: true},
items:[{
title: 'Normal Tab',
html: "My content was added during construction."
},{
title: 'Ajax Tab 1',
autoLoad:'ajax1.htm'
},{
title: 'Ajax Tab 2',
autoLoad: {url: 'ajax2.htm', params: 'foo=bar&wtf=1'}
},{
title: 'Event Tab',
listeners: {activate: handleActivate},
html: "I am tab 4's content. I also have an event listener attached."
},{
title: 'Disabled Tab',
disabled:true,
html: "Can't see me cause I'm disabled"
}
]
});

function handleActivate(tab){
alert(tab.title + ' was activated.');
}
});

i'm tried define variable

var MIF = new Ext.ux.ManagedIFrame({ autoCreate:{src:'http://www.extjs.com',height:350,width:'100%'}
,loadMask :false
});


but my iframe show out side tab

how show iframe within tab?

thank for help:)

evant
26 Apr 2008, 10:50 PM
Use ManagedIFramePanel. It extends Ext.Panel, so you can just add it directly like any other panel: http://extjs.com/learn/ManageIframe:Manual:Frame_Panel

shuang
26 Apr 2008, 11:28 PM
evant

i'm thank you very much actual really.

:D