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