Results 1 to 4 of 4

Thread: GridPanel Sorting event

  1. #1
    Sencha User
    Join Date
    Oct 2009
    Posts
    66
    Vote Rating
    0
      0  

    Default GridPanel Sorting event

    Hello,
    I am implementing remoteSorting in the grid
    I want to call a function when we click "Sort Ascending" or "Sort Descending" from the menu.
    Actually, i tried sortchange event. But this event is getting called after the store gets the response.

    Is there any event or how to call a function as soon as i click "Sort Ascending" or "Sort Descending" from the column menu?

    Thanks.

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default

    The sortchange event is fired after the grid is sorted, not before.

    I assume you are using remoteSort:true? In that case you should be writing a beforeload event handler for the store.

  3. #3
    Sencha User
    Join Date
    Oct 2009
    Posts
    66
    Vote Rating
    0
      0  

    Default

    Thanks for your reply, How can i track "Sort Ascending" or "Sort Descending" click inside beforeload event?

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default

    Code:
    store.on('beforeload', function(store, options){
      var pn = store.paramNames,
          sort = options.params[pn.sort];
          dir = options.params[pn.dir];
      ...
    });

Posting Permissions

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