Pagination
Sorting is a great way to wade through a large amount of data to find information. We can also help the user focus on a portion of a large data set by paginating the data. Pagination can be done in two ways—Server-Side Pagination and JavaScript Pagination.
Server-Side Pagination
Much like sorting, pagination is often performed on the server. If the data to be displayed is stored in a database, it is easy to pull out one chunk of information at a time using MySQL’s LIMIT
clause, ROWNUM
in Oracle, or equivalent methods in other database engines.
As with our initial sorting example, pagination can be triggered by sending information to the server in a query string, such as index.php?page=52
. And again as before, we can perform this task either with a full page load or by using AJAX to pull in just one chunk of the table. This strategy is browser-independent, and can handle large data sets very well.
Sorting and Paging Go Together
Data that is long enough to benefit from sorting is likely...