ExtJS grid callback on load and reload

21,344

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

 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
     },

     [...]
 }
Share:
21,344
Robocop
Author by

Robocop

Updated on November 11, 2020

Comments

  • Robocop
    Robocop over 3 years

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

    Any examples of this ?

    Thank you for your time.