I have my own data warehouse, which stores information about whether the store is loaded once or not.
Ext.example.Store = Ext.extend(Ext.data.Store, { loaded: false, initComponent: function() { this.superclass().initComponent.call(this); this.addEvents('load','beforeload'); }, isLoaded : function() { return this.loaded; }, listeners: { 'load' : function(store,records,options) { this.loaded = true; } } });
This worked fine until recently, I added a "beforeload" event listener to the instance of this store. Now the "listen" listener does not start.
var accountsDataStore = new Ext.example.Store({ id : 'account', proxy : new Ext.data.HttpProxy({ url : 'app/account/fetch/all', method : 'post', api : { destroy : 'app/account/delete' } }), reader : accountReader, writer : accountWriter, remoteSort : true, sortInfo : { field : 'createdOn', direction : "DESC" }, listeners: { beforeload: function(store, options) { var sort = options.params.sort;
What can i do wrong? Also, please let me know your suggestions for improvement.
source share