Sorting a table in-page rather than on the server?

  • 1
  • Question
  • Updated 2 years ago
  • Answered
Is it possible to have the sorting of a table by column run on the client side rather than querying the server? Like how you can select to have the table search run on the client rather than going to the server?

My actual requirement is to sort a table by a column but preserve row selections - if there's an option I'm missing that handles the above, preserving selections whilst sorting may already be handled...
Photo of Gary

Gary

  • 1,518 Points 1k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
Hi, I performed a quick test and you are correct in that selected rows do not stick across sorts. We'll need others more informed than I to chime in.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Yup. Same here. Tested yesterday.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Gary this is not currently possible.  Sorts and filters requery the model,  retrieving appropriate data from the server.  This action  removes the selections from any rows.  

If you change your search method to "client side" selections are retained.  I'm guessing we could add that sort of option in field sorts.  The problem is that the sorting would not retrieve any new data from the server - which seems appropriate in a search scenario,  but more problematic in a sort scenario.   We'll kick it around,  but no promises... 
Photo of Gary

Gary

  • 1,518 Points 1k badge 2x thumb
Thanks for the input everyone! I have an idea for a workaround, if I can get it developed, I'll try and share it back with the Community.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
That would be awesome! 
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
Gary,

Did you ever end up developing the workaround?
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
I think a good workaround could be to use a javascript library called tinysort http://tinysort.sjeiti.com/