處理說明: 1>grid.selectionchange Event
Ext.getCmp("grid_Single").on('selectionchange', function (me, eOpts) {
var cur_recs = Ext.getCmp('grid_Single').getSelectionModel().getSelection();
if (cur_recs.length == 0) {
Ext.getCmp('Btn_V30702A').setDisabled(true); // A:收單執行
Ext.getCmp('Btn_V30702B').setDisabled(true); // B:結單
Ext.getCmp("grid_Single").on('selectionchange', function (me, eOpts) {
var cur_recs = Ext.getCmp('grid_Single').getSelectionModel().getSelection();
if (cur_recs.length == 0) {
Ext.getCmp('Btn_V30702A').setDisabled(true); // A:收單執行
Ext.getCmp('Btn_V30702B').setDisabled(true); // B:結單
Ext.getCmp('Btn_V30702C').setDisabled(true); // C: 派遣單簽入
Ext.getCmp('Btn_V30702D').setDisabled(true); // D: 派遣單簽出
}
else {
Ext.getCmp('Btn_V30702A').setDisabled(true); // A:收單執行
Ext.getCmp('Btn_V30702B').setDisabled(true); // B:結單
Ext.getCmp('Btn_V30702C').setDisabled(true); // C: 派遣單簽入
Ext.getCmp('Btn_V30702D').setDisabled(true); // D: 派遣單簽出
var cur_rec = cur_recs[0];
var Tmp_STA = cur_rec.data['STA'].toString();
switch (Tmp_STA) {
case "B": {
Ext.getCmp('Btn_V30702A').setDisabled(false); // A:收單執行
break;
}
case "C": {
Ext.getCmp('Btn_V30702B').setDisabled(false); // B: 結單
Ext.getCmp('Btn_V30702C').setDisabled(false); // C: 派遣單簽入
Ext.getCmp('Btn_V30702D').setDisabled(false); // D: 派遣單簽出
break;
}
default: {
if ((Tmp_STA != "A") && (Tmp_STA != "Z") && (Tmp_STA != "X") )
Ext.getCmp('Btn_V30702E').setDisabled(false); // E: 撤銷
}
} // end of switch
}
}); // // end of datachanged
2>V20305E.js
Ext.getCmp('grid_M').on("selectionchange", function (view, selections, options) {
var np = s_JSON('s_form'); //TMFunction.js, 組合form上的查詢條件為json參數傳遞
//console.log("Ext.getCmp('s_STAT') : ", Ext.getCmp('s_STAT'));
var gridstore = Ext.getCmp('grid_D').store;
var cur_recs = Ext.getCmp('grid_M').selModel.getSelection();
if (cur_recs.length == 0) {
//Tmp_Str = "請先選擇要查詢的資料<br>";
//mywarnalert(Tmp_Str);
return;
}
var Tmp_REQMAF = nulltoStr(cur_rec.data["REQMAF"]).toString();
沒有留言:
張貼留言