2017-05-27 53 views
0

在我的Ext js應用程序中,我想在面板中查看excel & word文件,我試過iframe,僅在我的代碼下面下載excel在瀏覽器中,但我需要查看面板中的excel,如果我要更正我的代碼錯了,提前致謝。Ext Js在ext窗口或面板中打開excel文件和word文件?

new Ext.Window({ 
    title : "Excel", 
    width : 400, 
    height: 800, 
    layout : 'fit', 
    items : [{ 
     xtype : "component", 
     autoEl : { 
      tag : "iframe", 
      src : "Demo.xls" 
     } 
    }] 
}).show(); 

回答

0

你可以嘗試使用谷歌文件顯示Excel文件:

var ExcelFileName = *url to excel file* 
    new Ext.Window({ 
     title : "Excel", 
     width : 400, 
     height: 800, 
     layout : 'fit', 
     items : [{ 
      xtype : "component", 
      autoEl : { 
       tag : "iframe", 
       src : "https://docs.google.com/gview?url=" + ExcelFileName + "&embedded=true" 
      } 
     }] 
    }).show();