2024年5月2日 星期四

V20304 – 顯示資料後,自動勾選第1筆資料 - onload - Selection

目的: V20304 – 顯示資料後,自動勾選第1筆資料

處理說明: 1> onload
                              Ext.getCmp('grid_M').store.on("load", function (me, records, successful, eOpts) {
                                if (successful) {
                                    //console.log("Ext.getCmp('sub_Grid').store", Ext.getCmp('sub_Grid').store);
                                    //console.log("Ext.getCmp('sub_Grid').store.data", Ext.getCmp('sub_Grid').store.data);
                                    var Tmp_rec;
                                    if (Ext.getCmp('grid_M').store.data.length > 0) {
                                        Tmp_rec = records[0];
                                        //Tmp_rec = Ext.getCmp('grid_M').store.getAt(0);
                                        Tmp_rec.set('CHECK', true);

                                        //Ext.getCmp('grid_M').getSelectionModel().select(0);                
                                    }  // enf of if
                                }   // end of if success
                            });  // end of on load





沒有留言:

張貼留言