日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

發布時間:2024/8/26 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Extjs Window用法详解 2 打印具体应用 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

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、 //創建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(); } }] });

?

轉載于:https://www.cnblogs.com/1175429393wljblog/p/9178921.html

與50位技術專家面對面20年技術見證,附贈技術全景圖

總結

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

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。