我在Extjs上遇到了datepicker(Ext.picker.Date)的问题。当我在datepicker中选择日期时,我需要验证商店XXX是否有更改。我用boolean storeChanged检查一下,如果商店有变化,我需要停止 select事件。我怎么能这样做?
我目前的代码是:
Ext.define('App.controller.ActivityController', {
extend: 'Ext.app.Controller',
views: [
'App.view.panels.ManagedActivity'
],
storeChanged: false,
init: function() {
this.control({
'ManagedActivity > panel > datepicker': {
select: this.onSelectDatepicker
}
});
},
onSelectDatepicker: function(datepicker, date) {
if(this.storeChanged) {
var store = this.getGridActivity().getStore();
store.load({
params: {
date: Ext.Date.format(date, 'd-m-Y').toString()
}
});
} else {
// how stop the event ??
}
},
});