1>[列印點名表] – 檔案下載至前端 - standardSubmit: true, 且 必需以 form.submit, 不可用 Ext.Ajax
1>*.js
Ext.getCmp('mySubForm').submit({
url:
'../../api/V120902API/DoPRNLIST',
method: 'POST',
// 非 Ajax 的方式 //若要傳送檔案至前端, standardSubmit必需設為 true , 才會開新視窗,傳送 Binary檔案
//否則 Binary 檔案會放在原本的 Response
standardSubmit: true,
params:
np,
});
//顯示處理中..請稍待的訊息
var
mask = new Ext.LoadMask(Ext.getBody(), {
msg: '處理中,請稍待...'
});
mask.show();//使用 mask 需手動呼叫show() 方法下
var timer = setInterval(function () {
clearInterval(timer);
mask.hide();
timer = null;
var r = r_cookies('EX_DFile');
mysuccessalert(r);
},1000);
//1000ms = 3sec
}; // end of function mySub1_OkBtn_click()
2>[缺點現況維護]鈕 - TMGrid 的頁次未置於最下方 - Panel2 自動充滿畫面 - page
// [缺勤記錄維護] - 開啟子視窗, 所有的變數在 子視窗開啟時, 要重新宣告,
// --> 因為關閉子視窗時, 變數記憶體會被收回, 不重新宣告變數, 該變數會不存在
function RollEditBtn_click() {
var checkbox_id = 1;
//按鈕 : [確認] [取消] - [缺勤記錄維護]鈕
var mySub2_Btns = [
{
xtype: 'button', text: '確定', id:
'mySub2_OkBtn',
listeners: {
click: function () {
mysuccessalert("mysub2_確定 ");
mySub2_OkBtn_click();
}
}
},
];
var sub2_Columns = [
{ header: "員工編號", dataIndex:
"EMPLYID", width: 150, TMType: "string" },
{ header: "姓名", dataIndex:
"EMPLYID_", width: 100, TMType: "string" },
{ header: "缺勤", dataIndex:
"NWK", width: 50, TMType: "string" },
{ header: "備註", dataIndex:
"NOTE", width: 200, TMType: "string" },
{
header: '缺勤1',
dataIndex: 'NWK',
xtype: 'checkcolumn',
width: 60,
editor: {
xtype: 'checkbox',
cls:
'x-grid-checkheader-editor',
inputValue: 'Y',
uncheckedValue: 'N'
},
renderer: function (value,
metadata, record, rowIndex, colIndex, store) {
console.log("1
renderer value:", value);
var tempVal = '';
if ((value === 'Y') ||
(value === true)) { tempVal = 'checked'; }
var Tmp_Str =
"<input type='checkbox' name=" + DatetoStr(record.get('DT')) +
"_" + record.get('DEP') + "_" + record.get('EMPLYID') +
" " + tempVal + "
>";
console.log("1 renderer
return Tmp_Str:", Tmp_Str);
checkbox_id = checkbox_id +
1;
return Tmp_Str;
},
listeners: {
beforecheckchange: function
(me, rowIndex, checked, eOpts) {
mysuccessalert("2
befoercheckchange !!");
console.log("2
befoercheckchange checked 1:", checked);
if (checked) { checked
= false;checkVal = 'N'; }
else { checked = true;
checkVal = 'Y'; }
Ext.getCmp('sub2_Grid').store.getAt(rowIndex).set('NWK', checkVal);
console.log("2
befoercheckchange checked 2:", checked);
return true;
},
click: function () {
mysuccessalert("1 click event !!") },
//若 按 cellclick
checkchange: function (me,
rowIndex, checked, eOpts) {
mysuccessalert("3
checkchange !!");
console.log(" 3
checkchange checked :",
checked);
var checkVal = '';
if (checked) {
checkVal =
'Y';
console.log("3 checkchange 目前 checked= Y !! checkVal:", checkVal );
}
else {
checkVal = 'N';
console.log("
3 checkchange 目前 checked= N !! checkVal:", checkVal);
}
Ext.getCmp('sub2_Grid').store.getAt(rowIndex).set('NWK', checkVal);
console.log(" 4
checkchange Ext.getCmp(sub2_Grid).store.getat(rowIndex)",
Ext.getCmp('sub2_Grid').store.getAt(rowIndex));
}
}
},
];
// [缺勤記錄維護]鈕 - 子畫面欄位
var mySub2 = [
{
type:'panel', bodyStyle:
"background-color:transparent;", border: false, layout: { type:
'vbox', align: 'stretch' }, padding: "5",
items: [
{
xtype: 'panel',
id: 'sub2_panel1',
layout: { type: 'hbox',
align: 'stretch' },
flex: 5,
border: 1,
items: [
]
}, //end of panel1
{
xtype: 'panel',
id: 'sub2_panel2',
//title: 'sub2_panel2',
layout: { type: 'vbox',
align: 'stretch' },
//layout: 'fit',
flex: 10,
border: 1,
items: [
sub2_Grid ]
},
] // end of layout: "vbox", padding:
"5", items: [
}
//end of my_Sub2 , items[{
]
//end of my_Sub2 , items[
var win = getMyWindow("缺勤記錄維護", mySub2,
mySub2_Btns);
//Ext.getCmp('mySubForm').autoScroll =
true;
var Tmp_Sql = " SELECT EMPLYNM
"
+ " FROM
HR_EMPLYM "
+ " WHERE EMPLYID=" + AA(Ext.getCmp('sub2_LDMAN').getValue());
var Tmp_Str = SqlValue(Tmp_Sql);
Ext.getCmp('sub2_LDMAN_').setValue(Tmp_Str);
};
//console.log("2 win: ", win);
win.width = 700;
win.height = 400;
win.show();
//Runtime 設定 Panel2 : items[Sub2_Grid] 的高度, 以便充滿整個畫面
var Tmp_okpanel_Height =
Ext.getCmp('mySub2_OkBtn').getHeight()+20;
var Tmp_rHeight
=Ext.getCmp('mySubForm').getHeight()-Ext.getCmp('sub2_panel1').getHeight()-Tmp_okpanel_Height;
Ext.getCmp('sub2_panel2').setHeight(Tmp_rHeight);
};