christianbach / tablesorter

Flexible client-side table sorting
MIT License
1.03k stars 492 forks source link

Remembering sorting #121

Open atomAltera opened 7 years ago

atomAltera commented 7 years ago

Hello, how can I get know what columns are sorted and apply the same sorting on next visit of page?

I'm tried to handle sortStart and sortEnd events but I did not found there which columns are sorted

DavidBruchmann commented 7 years ago

you've to save the user-choice somewhere, probably a cookie is the easiest and most compatible way. But this option should be optional as not everyone want to make cookies used for tablesorter perhaps.

enthuzy commented 6 years ago

I use localStorage keys to set the sort order and on window.load retrieve https://www.w3schools.com/html/html5_webstorage.aspfor the sortList