Javascript Extjs 4:创建 iFrame 窗口

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6025814/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 19:55:41  来源:igfitidea点击:

Extjs 4: Create an iFrame Window

javascriptextjsextjs4

提问by neolaser

I am in need of creating an iFrame Window in Extjs. Previously in ExtJS 3.x I would do this:

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

bodyCfg: {
    tag: 'iframe'
}

But the WindowClass of ExtJS 4 seems not to have a bodyCfg.

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

Any ideas on how to make an iFrame ExtJS 4 Window?

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

回答by Egy Mohammad Erdin

I think autoElis what you are looking for...

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

Some advice from me, in Ext 4.x don't use autoElas a windowconfig property, it can make your window malformed.. I suggest you to use autoElin a component(items of your window)

我的一些建议,在 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();

The code above is better than

上面的代码比

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

Note: currenty you can't load Google and Facebook inside an iframe

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