日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

Extjs Window用法详解 2 打印具体应用

發(fā)布時(shí)間:2024/8/26 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Extjs Window用法详解 2 打印具体应用 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

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: '打印的內(nèi)容',
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: '關(guān)閉',
handler: function () {
me.close();
}
})];


me.callParent(arguments);
}

});

?

Extjs彈窗使用的第二種打印

?1、html文件

<div id="content"><h2>歡迎訪問(wèn)起飛網(wǎng)Extjs教程</h2><p>更多Extjs教程,請(qǐng)?jiān)L問(wèn)<a href="http://www.qeefee.com/zt-extjs">http://www.qeefee.com/zt-extjs</a></p> </div>
2、 //創(chuàng)建window var 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(); } }] });

?

轉(zhuǎn)載于:https://www.cnblogs.com/1175429393wljblog/p/9178921.html

與50位技術(shù)專家面對(duì)面20年技術(shù)見(jiàn)證,附贈(zèng)技術(shù)全景圖

總結(jié)

以上是生活随笔為你收集整理的Extjs Window用法详解 2 打印具体应用的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。