23

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

bodyCfg: {
    tag: 'iframe'
}

但是WindowExtJS 4 的 Class 似乎没有 bodyCfg。

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

4

1 回答 1

48

我想autoEl这就是你要找的...

我的一些建议,在 Ext 4.x 中不要autoEl用作window配置属性,它会使你的窗口格式错误。我建议你autoElcomponent(你的窗口项目)中使用

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

于 2011-05-17T07:16:40.160 回答