I had a problem recently where the Pager for the TableSorter plungin for jQuery was skipping pages after I manipulated the table (temporarily hid a row).
Just so you know what I was doing I was showing a table of 100 rows then paging it 10 records at a time. The goal was to allow the user to select items and add them to a list. When they selected an item I would hide the row and create a new row in a new table. If they wanted to remove the item I needed to have it show up in the table again.
If the user selected and item on page 1, went to page 2 and “unselected” the first item I needed to show it again where it originally was. Since the tablesorter hides the actual DOM elements you have to show the entire table again, show the row again then apply the Pager plugin to get pagination back. This worked great until you tried to change pages and it ended up skipping pages. The more times you ran tablesorterPager on the table the more pages it skipped.
I searched high and low for the answer and it turns out it was burried here in the innocuous line saying $(“#pager *”).unbind(‘click’);
It turns out that each time you run tablesorterPager() on the table it binds a new click event handler so it runs multiple times. The key is to either call the unbind method before each tablesorterPager() call or add that line to the contructor of the tablesorterPager plugin javascript file. Either way will work but the later is favorable since you only do it once.