Extjs打開window窗口自動加載html網頁


 

Window inherits the autoLoad config option from Panel. Note that I included all config options below, where most are optional:

var w = new Ext.Window({
  autoLoad: {
    url: "someApplicationURL",
    params: {
      firstName: "Shuman",
      lastName: "Human"
    },
    callback: someCallbackFuncion,
    scope: someObjectObject,
    discardUrl: true,
    nocache: true,
    text: "Loading...",
    timeout: 60,
    scripts: false
  },
  height: 300,
  width: 600
});

Keep in mind that this only supports URLs which are in the context of your application's domain, i.e. you can't plug in a URL of 'http://www.google.com' and expect it to work.

意思是說只能打開自己的應用程序,而網上的類似百度谷歌打不開的。只能在window里面內嵌一個panel即可打開

 

LOOK:

<script type="text/javascript">
    var center=new Ext.TabPanel({
        style:"padding:0 5px 0 5px",
        region:"center",
        activeItem:0,
        enableTabScroll:true,
        layoutOnTabChange:true,
        autoScroll:true,
        items:[{
            xtype:"panel",
            id:"index",
            iconCls:"homemanage",
            title:"測試",
            html:"<iframe src='http://www.geg.cn'scrolling='yes' frameborder=0 width=100% height=100%></iframe>"
        }]
    });
 
    Ext.onReady(function(){
        var vp=new Ext.Viewport({
            layout:"border",
            items:[center]
        });
    })
 
    </script>

我自己寫了一個,也基本上差不多就是這個樣子:

seePdfDocument : function(){
                if(!this.seePdfWin){
                    this.seePdfWin = new Ext.Window({
                                title : docNo + '報表預覽頁',
                                modal : true,
                                width : 1270,
                                height : 600,
                                layout : 'fit',
                                draggable : true,
                                resizable : true,
                                closeAction : 'hide',
                                //autoLoad : { url: 'http://www.qq.com',scripts: true, nocache: true}
                                 
                                items:[{
                                        xtype:"panel",
                                        id:"index",
                                        iconCls:"homemanage",
                                        title:"baidu一下 你就know",
                                        html:"<iframe src='http://www.baidu.com'scrolling='yes' frameborder=0 width=100% height=100%></iframe>"
                                    }]
                                //items : [pdfHeadManagerPanel]
                            });
                }
                    this.seePdfWin.show();
           }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM