使用iframe填充ExtJS Window組件

首先建立一個window,而後使用fit佈局(這種佈局的好處是子元素將填充整個控件),接下來將html屬性設置爲iframe便可。咱們來看看代碼:html

Ext.onReady(function () {
    Ext.get("btn1").on("click", function () {
        var win = Ext.create("Ext.window.Window", {
            title: "標題 - www.qeefee.com",
            height: 600,
            width: 1000,
            layout: "fit",
            modal: true,
            closable: true,
            animateTarget: "btn1",
            html: '<iframe style="overflow:auto;width:100%; height:100%;" src="http://youring2.cnblogs.com" frameborder="0"></iframe>'
        });
        win.show();
    });
});

這段代碼將在窗口中顯示一個iframe,src爲iframe要打開的網址。佈局

相關文章
相關標籤/搜索