2023年1月16日 星期一

V80209 – checkboxGroup -按[v]全部,則其他checkbox均Disabled,且為清為[ ]

目的: V80209 checkboxGroup  -[V]全部

1>按[v]全部,則其他checkbox均Disabled,且為清為[ ] 
2>按[ ]全部,則允許其他checkbox均Enabled,且為清為[ ] -






1>*.js

{
                        xtype: 'panel',
                        id: 'panel16',
                        layout: { type: 'vbox', align: 'stretch' },
                        //layout: { type: 'vbox'},
                        flex: 55,
                        border: 1,
                        items: [
                            {
                                xtype: 'checkboxgroup', fieldLabel: '異動原因', labelWidth: 60,
                               // layout: 'vbox',
                                columns: [.35,.35,.35],
                                id: 's_VRCODE',
                                items: [
                                    {
                                        boxLabel: '拆挪',
                                        name: 's_VRCODE',
                                        inputValue: 'C',
                                    },
                                    {
                                        boxLabel: '修理',
                                        name: 's_VRCODE',
                                        inputValue: 'R',
                                    },
                                    {
                                        boxLabel: '安裝',
                                        name: 's_VRCODE',
                                        inputValue: 'D',
                                    },                                    
                                    {
                                        boxLabel: '測試',
                                        name: 's_VRCODE',
                                        inputValue: 'T',
                                    },
                                    {
                                        boxLabel: 'DELETE解繳',
                                        name: 's_VRCODE',
                                        inputValue: 'E',
                                    },
                                    {
                                        boxLabel: '品保阻留',
                                        name: 's_VRCODE',
                                        inputValue: 'Q',
                                    },
                                    {
                                        boxLabel: '原件報廢',
                                        name: 's_VRCODE',
                                        inputValue: 'F',
                                    },
                                    {
                                        boxLabel: '預配',
                                        name: 's_VRCODE',
                                        inputValue: 'P',
                                    },
                                    {
                                        boxLabel: '空軍借件',
                                        name: 's_VRCODE',
                                        inputValue: 'H',
                                    },
                                    {
                                        boxLabel: '專案裝備撥補',
                                        name: 's_VRCODE',
                                        inputValue: 'Z',
                                    },
                                    {
                                        boxLabel: '入庫',
                                        name: 's_VRCODE',
                                        inputValue: 'I',
                                    },
                                    {
                                        boxLabel: '舊件繳回',
                                        name: 's_VRCODE',
                                        inputValue: 'O',
                                    },
                                    {
                                        boxLabel: '借件歸還',
                                        name: 's_VRCODE',
                                        inputValue: 'J',
                                    },
                                    {
                                        boxLabel: '機敏庫房保存',
                                        name: 's_VRCODE',
                                        inputValue: 'S',
                                    },
                                    {
                                        boxLabel: 'REWORK',
                                        name: 's_VRCODE',
                                        inputValue: 'A',
                                    },
                                    {
                                        boxLabel: '空軍存放',
                                        name: 's_VRCODE',
                                        inputValue: 'V',
                                    },                                    
                                    {
                                        boxLabel: '故障待修',
                                        name: 's_VRCODE',
                                        inputValue: 'M',                                        
                                    },                                                                        
                                    {
                                        boxLabel: '全部',
                                        name: 's_VRCODE',
                                        inputValue: 'ALL',                                        
                                        //checked: true,
                                        listeners:
                                        {
                                            change: function (me, newValue, oldValue, eOpts) {
                                                console.log("change!!");
                                                var Tmp_checkboxGroup = Ext.getCmp("s_VRCODE");
                                                console.log("newValue: ", newValue);
                                                console.log("oldValue: ", oldValue);
                                                for (i = 0; i < Tmp_checkboxGroup.items.length - 1; i++) {
                                                    console.log("i: ", i);                                                
                                                   var Tmp_checkbox = Tmp_checkboxGroup.items.items[i];
                                                    console.log("Tmp_checkbox: ", Tmp_checkbox);
                                                    Tmp_checkbox.setValue(false);
                                                    Tmp_checkbox.setDisabled(newValue);
                                                }
                                            }
                                        }
                                    },
                                ]
                            }, // end of s_異動紀錄
                        ]
                    },  //  end of items of panel16, flex:10
                ]
            },  // end of panel1


2>*.cs

           string Tmp_VRCODE = nvc["s_VRCODE"];  //異動原因
            ////將 A,C,B,D,ALL 字串加入 ""  --> "A","B","C","D" , 不含 ALL 傳回
            Tmp_VRCODE = myfunc.AddQuoteStr(Tmp_VRCODE);


 OracleCommand cmd = new OracleCommand();
            string Tmp_Sql1 = "", Tmp_Sql2 = "";  //for 日期起迄
            string Tmp_Sql = "  SELECT  RNK,RVNO,ARPNO,DITM,NM,REPN,RESN,REDT,INPN,INSN,RMK,PLNC,
                                                              INSC,NOTE,STLCT,STAT,FACWC,EFF "
                                        + "  FROM   ( SELECT  dense_rank()  over(order by  RVNO) as RNK,"
                                                       + "    RVNO,ARPNO,DITM,NM,REPN,RESN,REDT,INPN,INSN,RMK,PLNC,
                                                                INSC,NOTE,STLCT,STAT,FACWC,EFF "
                                                        + "   FROM     AMM_FRO3F16 "
                                                       + "   WHERE  1=1 ";
            //panel11

           //異動碼
            if (!myfunc.checkisnull(Tmp_VRCODE))
            {
             Tmp_Sql = Tmp_Sql + "  AND   RVNO IN (SELECT DISTINCT RVNO FROM  AMM_FRO3F16D WHERE  1=1 "
                                                       +                             " AND   VRCODE IN ("+ Tmp_VRCODE+")  )" ;
         }

沒有留言:

張貼留言