Extjs 4:创建一个 iFrame 窗口

Extjs 4: Create an iFrame Window

本文关键字:一个 iFrame 窗口 创建 Extjs      更新时间:2023-09-26

我需要在 Extjs 中创建一个 iFrame 窗口。以前在 ExtJS 3.x 中我会这样做:

bodyCfg: {
    tag: 'iframe'
}

但是 ExtJS 4 的Window类似乎没有 bodyCfg。

关于如何制作iFrame ExtJS 4窗口的任何想法?

我认为autoEl就是你要找的......

我的一些建议,在Ext 4.x中不要使用autoEl作为window配置属性,它会使您的窗口格式不正确。我建议您在component中使用autoEl(窗口的项目)

new Ext.Window({
    title : "iframe",
    width : 300,
    height: 300,
    layout : 'fit',
    items : [{
        xtype : "component",
        autoEl : {
            tag : "iframe",
            src : "http://www.yahoo.com"
        }
    }]
}).show();

上面的代码比

new Ext.Window({
    title : "iframe",
    width : 300,
    height: 300,
    layout : 'fit',
    autoEl : {
       tag : "iframe",
       src : "http://www.yahoo.com"
    }
}).show();

注意:目前您无法在iframe中加载Google和Facebook