ExtJS grid callback on load and reload

I have an Ext Grid and want to capture the JSON "success": false / true response to execute a function for each situation. I would like to have it as a callback function for each grid interaction with a PHP JSON file.

Any examples of this?

Thank you for your time.

+2


source to share


1 answer


You need to register callbacks in the load and exception events of the JsonStore. Something like that:



 var grid = new Ext.grid.GridPanel({
     store: new Ext.data.JsonStore({
          [...]
          listeners: {
               load: this.onLoadSuccess.crateDelegate(this),
               exception: this.onLoadException.createDelegate(this)
          }
     }),

     onLoadSuccess: function () {
          // success
     },

     onLoadException: function () {
         // error
     },

     [...]
 }

      

+8


source







All Articles