jQuery tablesorter how to find sortList object

前端 未结 3 851
清歌不尽
清歌不尽 2021-02-05 13:56

I am using the jQuery tablesorter plugin. I am wanting to store how a user has sorted the table on the page and automatically sort that way the next time the page loads. To do

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-05 14:18

    It might be a bit less overhead to save the last sort only when you need it like this:

    lastSortList=$("#mytable")[0].config.sortList;
    

    Remember to declare the variable in the right scope of course.

    (I think the questioneer's problem probably was that he had to get the DOM element via [0] and not the jQuery element.)

提交回复
热议问题