0
Ext.WIndow
上有2個按鈕。當我點擊按鈕1時,下面的代碼被執行。不正確的商店加載
當我點擊按鈕2時,第二組代碼被執行。這兩個按鈕都會從Store
加載
問題;
當我點擊1號按鈕,出現如下console.log
語句獲取打印(這也是我所期望的方式)
console.log ('win 1');
console.log('Came win 1');
在此之後,當我點擊第二個按鈕,我得到不正確的console.log
獲取顯示。
console.log ('win 2');
console.log('Came win 1'); // Which is coming from the 1st Buttons Load function.
按鈕1
var personCus= Ext.getStore('Person');
var record = personCus.getAt(0);
console.log ('win 1');
personCus.on('load', function() {
console.log('Came win 1');
var label= Ext.ComponentQuery.query('#win1> #labido')[0];
label.setText(record1.get('id'));
}
按鈕2
var personCus= Ext.getStore('Person');
var record = personCus.getAt(0);
console.log ('win 2');
personCus.on('load', function() {
console.log('Came win 3');
var label= Ext.ComponentQuery.query('#win2> #labid1')[0];
label.setText(record1.get('id'));
}