Results 1 to 3 of 3

Thread: Trying to access load event

  1. #1
    Sencha User
    Join Date
    Nov 2010
    Posts
    73
    Vote Rating
    -1
      0  

    Default 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:
    HTML Code:
    Ext.define('MyApp.custom.Store', {
    	extend: 'Ext.data.Store',
        listeners: {
                    load: function() {
                        alert('load event fired!');
                    }
              }
    });
    Now in my controller I do this:
    HTML Code:
    onLaunch: function() {
        		languageStore = this.getLanguageStoreStore();
            	languageStore.load({
    	            scope   : this,
    	            callback: function(records, operation, success) {
                   console.log(records);
    	            }
    
    
              })
    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!

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Vote Rating
    1271
      0  

    Default

    Code:
    Ext.define('MyApp.custom.Store', {
        extend: 'Ext.data.Store',
    
        constructor: function() {
            this.on('load', function() {});
    
            this.callParent(arguments);
        }
    });
    Don't put listeners like that on the prototype or the config object.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Nov 2010
    Posts
    73
    Vote Rating
    -1
      0  

    Default Thank you

    This worked, thanks for the heads up.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •