PDA

View Full Version : A problem was happened in Ext4 about iframe element. Who can help me?



nozer
6 Dec 2011, 1:40 AM
I want show a page in the Ext.window use iframe.

It's my code:

var window = Ext.create('Ext.window.Window', {
title: '供求详情',
autoScroll: true,
layout: 'fit',
modal: true,
frame: true,
frameHeader: true,
html: '<iframe src="http://www.jiezanke.com/Supply/SupplyDetail.html"></iframe>'
}).show();

When I test the window,I can't see the iframe element.This element(iframe) seems to have been filtered out.What do I do? In ext4.My English sucks,everybody sorry.

tobiu
6 Dec 2011, 3:34 AM
i would use the items config instead of html and add an iframe with the autoEl:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.AbstractComponent-cfg-autoEl

if you prefer the html, i would inspect the dom with the debugging tools, probably the iframe just needs height and width set to 100%.

nozer
6 Dec 2011, 4:30 PM
Thanks tobiu,

I was change my code:


var window = Ext.create('Ext.window.Window', {
title: '供求详情',
autoScroll: true,
layout: 'fit',
modal: true,
items:[{
xtype: 'component',
autoEl: {
tag: 'iframe',
src: 'http://www.jiezanke.com/Supply/SupplyDetail.html'
}
}]
}).show();


But firebug tips me:"Uncaught TypeError: Cannot call method 'addCls' of null"