顯示具有 觸發event 標籤的文章。 顯示所有文章
顯示具有 觸發event 標籤的文章。 顯示所有文章

2022年12月7日 星期三

V80201 – [編審狀態]異動時, 依目前編審狀態改變 radioGroup選項

目的: V80201 – [編審狀態]異動時, 依目前編審狀態改變 radioGroup選項

處理說明: 1>[編審狀態]欄位的 EditPick 的 isSuspendevent 必需設為 false,
                      當[編審狀態]欄位異動時, change event 才會觸發
                  2>設定 radio1.setCheck(true);



2>*.js
{xtype: "fieldcontainer", fieldLabel: "編審狀態", labelWidth: 70, layout: "hbox", flex: 2,
             items: [
          { xtype: "textfield", id: "s_STAT", name: "s_STAT", width: 30, padding: "0 4 0 0", value: "C" },
          { xtype: "textfield", id: "s_STAT_NM_", name: "s_STAT_NM_", width: 80, padding: "0 4 0 0", readOnly: true, fieldCls: "readonly", value: "已核准" },
          {
             xtype: "button", id: "s_btn_STAT", name: "s_btn_STAT", text: "...",
             handler: function () {
                  //isSupendevent=false; 才會觸發 event 
                      var win = EditPickx('編審狀態', '../api/V80201API/get_s_STATPick', ['STAT', 'DESCPT'], ['s_STAT', 's_STAT_NM_'], J_pickstore_s_STAT, J_pickcolumns_s_STAT,
                                                true, false);
                                            win.show();
                                        }
                                    },
                                ]
                            },// end of s_編審狀態                    



Ext.getCmp("s_STAT").on("change", function (me, newValue, oldValue, eopts) {
    //Ext.getCmp("s_STAT").on("blur", function () {
        console.log("狀態 s_STAT change !!");
        var Tmp_STAT = Ext.getCmp('s_STAT').getValue();
        if (Tmp_STAT == "C") {  //已核准 - 處理完成日期
            Ext.getCmp("s_radio1").setValue(true);
            Ext.getCmp("s_radio2").setValue(false);
        }
        else {  //未核准 - 預計編審完成日期
            Ext.getCmp("s_radio1").setValue(false);
            Ext.getCmp("s_radio2").setValue(true);
        }
    });