-
16 Dec 2011 9:15 AM #1
Trying to access load event
Trying to access load event
Hello, I see in the source code for a store that onProxyLoad fires:
me.fireEvent('load', me, records, successful);However I can't seem to access it. I am creating a base store that all other stores descend from and I would like to capture this event:
Here is my custom.store:
Now in my controller I do this:HTML Code:Ext.define('MyApp.custom.Store', { extend: 'Ext.data.Store', listeners: { load: function() { alert('load event fired!'); } } });
If I extend onProxyLoad I can get my code to work but it seems they want us to use the load event. Any help is greatly appreciated, thanks!HTML Code:onLaunch: function() { languageStore = this.getLanguageStoreStore(); languageStore.load({ scope : this, callback: function(records, operation, success) { console.log(records); } })
-
16 Dec 2011 11:34 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
Don't put listeners like that on the prototype or the config object.Code:Ext.define('MyApp.custom.Store', { extend: 'Ext.data.Store', constructor: function() { this.on('load', function() {}); this.callParent(arguments); } });Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
16 Dec 2011 12:27 PM #3
Thank you
Thank you
This worked, thanks for the heads up.


Reply With Quote