PDA

View Full Version : Using IFrame as contentEl in Ext.Window not working in IE



OB_SN
1 Jul 2010, 9:49 AM
I'm trying to render an iframe into an Ext.Window component using contentEl, but for some reason, it's not working in IE. The Window pops up, but its width is huge, and there's no content. It works fine in all other browsers. Does anyone have any suggestions or a better way to achieve what I'm trying to do? My code:



Ext.EventManager.onDocumentReady(function(){
var bar = document.createElement("iframe");
bar.style.width = "667px";
bar.style.height = "376px";
bar.id = "_extpop";
bar.src = "myPage.html";
document.body.appendChild(bar);
var foo = new Ext.Window({id: "MyDialog", title: "test dialog", contentEl: "_extpop", modal: true, closeAction: "hide"});
foo.render(document.body);
});

// Use Ext.getCmp('MyDialog').show(); to show it

mankz
1 Jul 2010, 10:42 AM
How about:



Ext.onReady(function(){

var foo = new Ext.Window({id: "MyDialog", width: xx, height: xx, layout : 'fit', title: "test dialog", html: '<iframe src="xx"></iframe>', modal: true, closeAction: "hide"});
foo.show();
});

Animal
1 Jul 2010, 10:47 AM
That won't work.

Best to use bodyCfg



bodyCfg {
tag : 'iframe',
style: 'border: 0 none',
src: 'http://foo.com/'
}

}

mankz
1 Jul 2010, 10:58 AM
You're right, my bad!

OB_SN
6 Jul 2010, 5:43 AM
That worked Animal, thanks!