Grid Sort Event

10 posts, 0 answers
  1. J
    J avatar
    4 posts
    Member since:
    Feb 2012

    Posted 04 Apr 2012 Link to this post

    Hi,

    Is it possible to capture the event when a grid is sorted and to know on which column it was sorted by?

    J
  2. David
    David avatar
    7 posts
    Member since:
    Mar 2012

    Posted 05 Apr 2012 Link to this post

    I know the dataBound event fires, but I would also like to know if there's a way to tell if that's a sort as opposed to anything else.
  3. Kendo UI is VS 2017 Ready
  4. Rolando Rosales
    Rolando Rosales avatar
    3 posts
    Member since:
    Apr 2006

    Posted 11 May 2012 Link to this post

    this would be nice!
  5. Basem
    Basem avatar
    27 posts
    Member since:
    Dec 2010

    Posted 23 May 2012 Link to this post

    +1 for this!
  6. James Shelton-Agar
    James Shelton-Agar avatar
    108 posts
    Member since:
    May 2008

    Posted 04 Jul 2012 Link to this post

    +1 The only workaround I can think of is to return the sorting param in JSON...which is....mmmm
  7. Vikas
    Vikas avatar
    1 posts
    Member since:
    Mar 2013

    Posted 10 Apr 2013 Link to this post

    +1. Really need this to identify whether the grid was sorted, paginated, filtered. As of now there is no  way to identify it. Is there a workaround for this? 
  8. Michael
    Michael avatar
    2 posts
    Member since:
    Aug 2014

    Posted 18 Aug 2014 Link to this post

    +1, hopefully bumping this thread up

    I could really use an event callback for the "sort" event for a grid since I want to re-initalize some custom HTML-based click handlers that go away once the grid is sorted (and I assume the HTML objects are re-created)
  9. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 21 Aug 2014 Link to this post

    Hello Michael,


    There is no sort event available in the dataSource. This suggestion is posted in our user voice portal. If you consider that it will be useful addition to the framework, you could place your vote there. If it becomes popular among the community, we will consider to implement it in future releases.

    As for the exact case, you could use the sort() method of the dataSource to retrieve the current sort configuration and compare it will the previous one. For example a JS variable could be used to store the previous sort configuration.

    I hope this information helps.

    Regards,
    Dimiter Madjarov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  10. Michael
    Michael avatar
    2 posts
    Member since:
    Aug 2014

    Posted 21 Aug 2014 in reply to Dimiter Madjarov Link to this post

    Hey Dimiter, 

    Thanks for your response. It looks like the Data Bount Event might be able to help with this. It looks like that event fires every time the data is drawn or re-drawn to the DOM, which is pretty much what I'm looking for.

    Specifically, I'm looking for a way to apply custom CSS to individual cells in the grid in such a way that would be pretty hard to do via Kendo templates. This seems like the best way to do it, just re-apply the CSS everytime the data is drawn

    Thanks,
    Mike
  11. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 22 Aug 2014 Link to this post

    Hi Michael,


    Indeed this is the correct approach in the current case. Let us know if you experience any difficulties.

    Regards,
    Dimiter Madjarov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready