目的: V30701 – Delay –新增&存檔後,延遲1秒(待資料重新顯示), 才Locate至該筆資料
處理說明: 1>[存檔]鈕, 按存檔時,延遲1秒(待寫入資料庫),才重新顯示資料
Ext.getCmp('btn_save').on('click', function () { ...},
Ext.getCmp('btn_save').on('click', function () { ...},
this,
{ delay: 1000 }
);
2>重新顯示資料時,Delay 1 秒, 才 Locate 新增的資料
Ext.getCmp('btn_Show').fireHandler();
var task = new Ext.util.DelayedTask(function () {
var Tmp_cnt = Ext.getCmp("grid_Single").store.getCount();
Ext.getCmp("grid_Single").getSelectionModel().select(Tmp_cnt-1);
Ext.getCmp("grid_Single").getView().focusRow(Tmp_cnt-1); });
task.delay(1000);
1>*.js
//存檔後,重新顯示資料
Ext.getCmp('btn_save').on('click', function () {
//按[存檔]鈕, 不需重新顯示 ,
//否則原本無資料, 第一筆新增存檔時, 會顯示無資料
Ext.getCmp('btn_Show').fireHandler();
//Ext.getCmp("grid_Single").getSelectionModel().selectRow(7);
var task = new Ext.util.DelayedTask(function () {
var Tmp_cnt = Ext.getCmp("grid_Single").store.getCount();
Ext.getCmp("grid_Single").getSelectionModel().select(Tmp_cnt-1);
Ext.getCmp("grid_Single").getView().focusRow(Tmp_cnt-1);
});
task.delay(1000);
},
this,
{ delay: 1000 }
);
沒有留言:
張貼留言