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

2023年5月18日 星期四

V20302B - 開啟子畫面時, 加入副本人員,但未顯示在畫面 - load() ,store

 目的: V20302B – 開啟子畫面時, 加入副本人員,但未顯示在畫面

處理說明:  1>開啟子畫面時, sub1_Grid2.store 會重新 load()
                   2>[副本人員]加入資料時, sub1_Grid2.store 尚未載入完成  - store load 尚未完成       
                   3>sub1_Grid2.store 載入完成時, 會覆蓋原本的 [副本人員]加入資料
                       --> 以致畫面上未加入資料


1>*.js

function ShowEmailnot6(par_EMPLYIDnot6) {
    Ext.getCmp('sub1_Grid2').store.getProxy().url = '../api/V20302BAPI/getsubData2';
    Ext.getCmp('sub1_Grid2').store.getProxy().extraParams = np; //分頁OK,篩選條件OK    
    Ext.getCmp('sub1_Grid2').store.load();                                                
    //將 CSM_AF@TLS_245 的專案承辦人(以@分隔人員編號) 加入 副本.人員 [姓名][Notes_Email]
    Add_sub1_Grid2(par_EMPLYIDnot6);
    Ext.getCmp('sub1_Grid2').getView().refresh();
   
}

--> store.load();
      Add_sub1_Grid2(par_EMPLYIDnot6);   //store尚未執行完成, 就 加入資料
      //等 store.load() 完成, sub1_Grid2原本加入的資料, 又被清空, 所以畫面無資料

-->改成 load 完成後,再加入資料即可
    store.on('load',function(){
        Add_sub1_Grid2(par_EMPLYIDnot6);
        Ext.getCmp('sub1_Grid2').getView().refresh();
   
    }