Hi,
I'm looking into situations in database-oriented web applications when one should rely on client side sorting of tables over sorting on the server side. One particular situation that is bugging me is pagination.
When trying to paginate a large table (say 10000 rows), as well as sort it by a particular column, what would be the best approach to take?
I understand that some issues related to this are:
- I cant return the whole table to the client side in one go
- I can't sort as many as 10000 records with javascript
- sorting the table will involve sorting rows in all pages, not just the current page.
So do you have any more issues to add to this list?
What approach would lead to a good mix of client side and server side interaction so that server load is minimized?
Cheers,
jrh
ADDITION:
Okay, sorting on the database and returning the reqd page, a prev page and a next page seems to be the best bet.
Now consider this:
The user is on page (3 of 10) of the table sorted by serial number. Now the user clicks on the header named "username", wanting to sort the table by username.
Quesion: Should the end result be "page (1 of 10) sorted by username" or should it be "page (3 of 10) sorted by username"?
I know this is a very subjective question, but what would you recommend and why?
jrh