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
//panel2 的高度必需設定, 否則 panel2的高度會隨 Grid而變化
win.on('resize', function (me, width, height, eOpts) {
//console.log("win.resize height=",height);
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);
//console.log("win.resize Tmp_rHeight=", Tmp_rHeight);
});
// [缺勤記錄維護] - 開啟子視窗, 所有的變數在 子視窗開啟時, 要重新宣告,
// --> 因為關閉子視窗時, 變數記憶體會被收回, 不重新宣告變數, 該變數會不存在
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);
};
3>V120902 – 在主機端無法正常下載檔案
Ans: 發佈至主機時, web.config 檔案必需設定 user/password , 以便存取主機端的目錄 若沒設定,則無法存取主機端的目錄的權限,以致無法下載SS_FILES至主機目錄
1>web.config
<system.web>
<!--server端帳密,發行時請取消註解-->
<!-- identity impersonate="true" userName="webadmin" password="Aidc@856+123" /-->
--> 發佈至測試區/正式區時, 如上web.config 檔案 必需 remark
<identity impersonate="true" userName="webadmin" password="Aidc@856+123" />