Force pagination reset?

Force pagination reset?

horstm22horstm22 Posts: 2Questions: 0Answers: 0
edited December 2012 in General
At pobox.com, we use DataTables to display listings of spam we caught for people's accounts. We segment that spam in different ways on different pages, but, from the customer's perspective, each of those pages should behave the same way. After numerous complaints at the outset about changes "getting lost" (in actuality, made on one page, but not another), we forced all the tables in the section to use the same cookie for settings.

For the most part, everything works swimmingly. BUT. There's one big catch. Switching pages retains your pagination information, which can result in people seeing "no matching records found", even when they exist.

For example, let's say you're viewing entries 41-50 on page 5, and search. You are taken to a new table with only 5 entries. The View menu will say "Page 5 of 1", and the table content will say "no matching records found". But, if you click the button to return to the first page of results (or page back to Page 1), you will see the correct information.

So, is there a way for me to handle this? Ideas we came up with:
* force a pagination reset when changing pages
* store just the pagination information in a separate cookie
* (insert other possible solution here)

Thanks for any assistance you can provide!

Replies

  • allanallan Posts: 63,530Questions: 1Answers: 10,474 Site admin
    Sounds like you might want to reset the paging on every filtering action? Attach an event handler which will call `table.fnPageChange( 'first' );` to your filtering input perhaps?

    Allan
  • horstm22horstm22 Posts: 2Questions: 0Answers: 0
    Thanks, this fixed it!
This discussion has been closed.