On Apr 6, 2007, at 13:53 , Paul wrote:
I’m curious how you all handle paged tabular data that also needs
to be sortable. I would typically rely on ajax to retrieve next
25 / previous 25 rows, but if the user can sort any column they
want they effectively change what “next 25” means every time they
click a column header. Do I need to abandon the tablesorter plugin
and simply use ajax to rebuild the table or is there a better way?
Yes, you pretty much have to do both on the browser or both on the
server. You can send all the data to the browser and have it paged
there, or you can perform the sort on the server. Here's a relevant
excerpt from The Good Book (no not that one):
Sorting and Paging Go Together
Data that is long enough to benefit from sorting is likely long
enough to be a candidate for paging. It is not unusual to wish to
combine these two techniques for data presentation. Since they both
affect the set of data that is present on a page, though, it is
important to consider their interactions while implementing them.
Both sorting and pagination can be accomplished either on the server
or in the web browser. We must keep the strategies for the two tasks
in sync, however. Otherwise, we can end up with confusing behavior.
Suppose, for example, that both sorting and paging is done on the
server:

When the table is re-sorted by number, a different set of rows is
present on page one of the table. If paging is done by the server and
sorting by the browser, though, the entire data set is not available
for the sorting routine and so it goes wrong:

Only the data already present on the page can be displayed. To
prevent this from being a problem, we must either perform both tasks
on the server, or both in the browser.
--
Jonathan Chaffer
Technology Officer, Structure Interactive