2
我有一個店,它看起來像這樣:metachange事件不會觸發
Ext.define('GridGeneral.store.GridGeneralStore',{
extend:'Ext.data.Store',
model:'GridGeneral.model.GridGeneralModel',
autoLoad:true,
proxy:{
type:'ajax',
url:'/api/grid/gridgeneralstore.php',
reader:{
type:'json'
}
}
});
內部控制器我想火`metachange」事件。我試圖這樣做:
init:function(){
Ext.getStore('GridGeneralStore').addListener('metachange',this.metaChanged, this);
//^^^not fired
Ext.getStore('GridGeneralStore').addListener('load',this.loaded, this);
//^^^ this is ok
},
metaChanged:function(store, meta){
console.log('metaChanged'); // see nothing in the colsole
},
loaded:function(){
console.log('loaded'); // everything works fine!
}
那麼,我做錯了什麼?
謝謝你,先生!你是個天才! – Jacobian
事件未被解僱是一件有用的事情。例如,如果您使用緩衝網格或分頁工具欄,則只需在第一次調用服務器時發送元數據。您的後端只能在頁面爲1時發送元數據,並且您的網格需要重新配置或者您的模型需要額外的字段。 – Tarabass