tablesorter pager

為{幸葍}努か 提交于 2019-12-04 12:03:58

问题


I'm working with tablesorter and I've not been able to find any documentation about the plugin tablesorter pager. The thing is that I have a table that displays some data and in each row there is a delete link that has attached to it the unique identifier of the element that it's going to be deleted (obviously). My question is, is it possible to save the page in which I'm at the moment of deleting, and then set the pager straight to the page it was before? It is because when I reload the table after deleting the row, it goes back to the first page.

What I want to do is something like this:

//Before deleting 
var page = //Here is what I'm asking for, a way to get the page that is on now
var rowsPerPage = //A way to obtain the size option of the pager
//Delete row

//Refresh table and then a way to set the 
///page where I was again.
     $("#TST").tablesorter(...)
                 .tablesorterPager({
                     container: $("#TSTPager"),
                     positionFixed: false,
                     size: 5
                 });

Thank you very much, Victor


回答1:


If you click on the tablesorter tag, you will find several other developers wrestling with this type of problem, such as Need Help with Jquery TableSorter Pager plugin.

In an answer there, and replies to other similar questions, a suggestion is made to use DataTables.net instead.

Yes, it's frustrating to think of changing tools at this point, but the level of frustration with your paging problem, and the favorable opinions about the other tool, suggest that you might be able to get this problem solved more quickly, and get your project back on track, by changing tools.




回答2:


This is a very old question, but for what it's worth, the Pager plug-in now has an option called savePages that saves the pagination state even on refresh.

This issue covers it: https://github.com/Mottie/tablesorter/issues/444



来源:https://stackoverflow.com/questions/3094423/tablesorter-pager

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!