Reputation: 6680
All my table data comes in a sorted order. I am using table sorter to sort on a column by date. It is working fine. Now I want to provide a option to revert the sort to original sorted order which i received.
How can i do that
1) one way i am thinking is cloning the table before sending it to table sorter. Is there any better approach than that
Thanks
Upvotes: 0
Views: 328
Reputation: 86413
I have a fork of tablesorter on github in which I added a new option named sortReset
which after clicking on the header a third time will reset the table to it's original order. Check out this demo
Upvotes: 2
Reputation: 6680
I added a new column to original table which is numbering to rows. So now if i sort by date and want the previous order, i simply sort by the newly created column.
Upvotes: 0