目的: V80201- 子視窗顯示資料,顯示第1筆的欄位值
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();
}
}
);
沒有留言:
張貼留言