extjs4 打开pdf文件

 

buttons: [{
    text :'OPEN DOCUMENT',
    formBind : true,
    handler:function() {
        new Ext.window.Window({
            title: 'Document',
            height: 800,
            width: 800,
            layout: 'fit',
            items: [{
                html: '<iframe src="..."></iframe>'
            }]
        });
    }
}]

--------------------------------------------------
网上找的一段代码,如果是动态的话,应该要获取到item下的html的值,然后赋值

 

 

var mConfig = { 
       mediaType   :'PDFFRAME',   //this is the most reliable cross-browser 
       url         : 'servlet/PdfServlet?invoice=2319283',
       unsupportedText : 'Acrobat Viewer is not Installed',
   resizable   : true    // < -- what's this?
       autoSize : true
    };                  
var p = new Ext.ux.MediaWindow({  
        id            : 'PDFViewerWin',
        bodyStyle    : 'position:relative; padding:0px;',
        width        : 600,
        height        : 400,
        mediaCfg    : mConfig,
        title        : 'Title-1'
 }).show();

 

 

 

 

你可能感兴趣的:(extjs4)