Search code examples
jquerytablesorterpager

tablesorter pager recognize the page


I have used tablesorter with pager in my website. The problem is that pager will record the pager number.

When i click to change the pager to p.2 After that, I change the website to other pages. I come back to that page again. It will show the data in p.2 My expected result should be p.1

It means when i go to other pages and access again to the tablesorter. The pager should show p.1. How can I do that?

In the pager option, I have set to page 1

// starting page of the pager (zero based index)

page: 1,

Step1: Change page in the jsfiddle(e.g P.8)

Step2: Click run

It stay on the same page after running

Expected result: every time running return back to page 1


Solution

  • Reading the documentation:

    In v2.11, the savePages option was added to saves the current page size and number (requires storage script).

    So just add the savePages: false option to pager configuration:

    $('table').tablesorterPager({
        [...],
        savePages: false
    });
    

    Updated fiddle here