0
votes

For the listeners part of this data store in sencha touch, what exactly does the 'load' event mean? I searched the api documentation but was unable to find an explanation in the data store section nor the observable class section.

     new Ext.data.Store({
        model: "",
        proxy: {
            type: "ajax",
            url : "/search/json/",
            reader: {
                type: "json",
                root: "searchResult"
            }
        },
        listeners: {
            load: myapp.results    //Note: myapp.results is a function defined elsewhere
        }
    });

As an additional note, if anyone knows of a reference which lists all of the listener 'eventnames' such as load, and their significance I would be grateful if they would be so kind as to post them here. (The sencha documentation only says: 'The name of the event to listen for. May also be an object who's property names are event names. See' and ends at See )

3

3 Answers

0
votes

This event is fired when the data is loaded. You must assign a function to use it.

listeners:{
     load:function(store,records,options){
          // Do stuff, you can access here to the loaded store, the loaded records and options
     }
 }

It will be called each time the data is loaded, on refresh, on page change, etc.

2
votes

Sencha API says "Fires whenever the store reads data from a remote data source." There is all different event-names too. Am I missing something?

0
votes

Consider two components that is one is dependent upon another component which is to used as input by it in such a case we can make use of load function.