Extjs Window用法詳解 2 列印具體應用

來源:互聯網
上載者:User

標籤:efi   str   col   ane   doc   www.   task   min   www   

Extjs 中的按鈕元素

{
xtype: ‘buttongroup‘,
title: ‘列印‘,
items: [
me.tsbDel = Ext.create(‘Ext.button.Button‘, {
text: ‘列印123‘,
iconCls: ‘tool_print‘,
scale: ‘large‘,
iconAlign: ‘top‘,
handler: function () {
var window = me.createWindow(‘www.view.report.vwwprint‘, {

params: {
oid: record.data.id,
}

});
}
}), ]
},

 

Extjs彈窗使用的第一種列印

Ext.define(‘www.view.report.vwwprint‘, {
extend: ‘www.controls.WinBase‘,
width: 800,
height: 600,
autoShow: true,
modal: true,
stateful: false,
maximizable: false,
minimizable: false,
resizable: false,
layout: ‘fit‘,
title: ‘列印的內容‘,
iconCls: ‘icon_taskboxlist‘,
initComponent: function () {
var me = this;
me.items = [
{
xtype: ‘panel‘,
border: 0,
html: ‘<iframe id="ifPrint" name="ifPrint" src="./D/Box/PrintReport/?‘ + Ext.Object.toQueryString(me.params) + ‘" width="100%" height="540" frameborder="0" scrolling="auto"></iframe>‘
}];
me.buttons = [
me.btnOK = Ext.create(‘Ext.button.Button‘, {
text: ‘列印‘,
handler: function () {
var iframe = document.getElementById(‘ifPrint‘);
iframe.contentWindow.focus();
iframe.contentWindow.print();
}
}),
me.btnCancel = Ext.create(‘Ext.button.Button‘, {
text: ‘關閉‘,
handler: function () {
me.close();
}
})];


me.callParent(arguments);
}

});

 

Extjs彈窗使用的第二種列印

 1、html檔案

<div id="content">    <h2>歡迎訪問起飛網Extjs教程</h2>    <p>        更多Extjs教程,請訪問<a href="http://www.qeefee.com/zt-extjs">http://www.qeefee.com/zt-extjs</a>    </p></div>
2、
//建立windowvar win = Ext.create("Ext.window.Window", {    id: "myWin",    title: "樣本視窗",    width: 500,    height: 300,    layout: "fit",    autoShow: true,    contentEl: "content",
items: [          buttons: [        { xtype: "button", text: "確定", handler: function ()  
//{
//this.up("window").close();
//}
var iframe = document.getElementById(‘ifPrint‘);
iframe.contentWindow.focus();
iframe.contentWindow.print();
}, { xtype: "button", text: "取消", handler: function () { this.up("window").close(); } } ]
});

 

Extjs Window用法詳解 2 列印具體應用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.