Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extjs 4: Create an iFrame Window

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

bodyCfg: {
    tag: 'iframe'
}

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

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

like image 804
neolaser Avatar asked May 17 '11 03:05

neolaser


1 Answers

I think autoEl is what you are looking for...

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

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

like image 157
Egy Mohammad Erdin Avatar answered Nov 12 '22 09:11

Egy Mohammad Erdin