顯示具有 select 標籤的文章。 顯示所有文章
顯示具有 select 標籤的文章。 顯示所有文章

2023年11月22日 星期三

V80E02 – DataTable 搜尋值 .Select(“EMPLYID LIKE ‘3125672%’); -dt1.Select(:過濾條件);

 目的: V80E02 – DataTable 搜尋值 .Select(“EMPLYID LIKE  ‘3125672%’);

處理說明: 1>由 SQL 取得 DataTable
                  2> DataRow[] dr_Ary=DataTable.Select (:過濾條件) ;
                  3>dr_Ary.length>0 ,則欄位值設為 'V'


1>*.js
DataRow[] dr_Ary;
 Tmp_Sql = "   SELECT  "+myfunc.AA2("CourseOfferingName") 
                                + "    FROM    AIDviewTrainingRecords_Y40@AMM_F16V_SOI  "                                  
                                +"     WHERE  1=1 "                                   
                                + "   AND    " + myfunc.AA2("EmployeeID") + "=" + myfunc.AA(Tmp_EMPLYID); 
Tmp_dt2 = myfunc.SqlOpen(Tmp_dt2, Tmp_Sql);
Tmp_condSqlStr = " CourseOfferingName  LIKE " + myfunc.AA(Tmp_DOCMT + "%");
dr_Ary = Tmp_dt2.Select(Tmp_condSqlStr);
if (dr_Ary.Length>0)
      dr[Tmp_DOCMT] = "V";
else
     dr[Tmp_DOCMT] = "";


2022年12月13日 星期二

V80201- 子視窗顯示資料,顯示第1筆的欄位值 -select(0)無效

 目的: V80201- 子視窗顯示資料,顯示第1筆的欄位值

處理說明: 1>select(0)無效
                   2>改用 grid_store.data.items[0].data["specdata1"];



1>*.js

Ext.getCmp('sub_Grid').store.on("load", function (me, records, successful, eOpts) {        
        if (successful) {
            console.log("successful");
            console.log("Ext.getCmp('sub_Grid').store.data", Ext.getCmp('sub_Grid').store.data);
            var grid_store = Ext.getCmp('sub_Grid').store;
            if (grid_store.getCount() > 0) {
                //若有資料,則預設選擇第一筆
                var Tmp_Str = grid_store.data.items[0].data["specdata1"];
                Ext.getCmp("sub_specdata1").setValue(Tmp_Str);
                /*
                //select(0) 無效
                console.log("count>0");
                Ext.getCmp('sub_Grid').getSelectionModel().select(0);                
                Ext.getCmp('sub_Grid').fireEvent("selectionchange");
                */
            }
            win1.show();
        }
    }
    );