From time to time, you will want to show data in your website and allow the data to be sorted and searched.
It always impresses me that whenever I need to do anything with jQuery, there are usually plugins available, which are exactly or close to what I need.
In this chapter, we will look at:
How to install and use the
DataTables
pluginHow to load data pages on request from the server
Searching and ordering the data
The DataTables
plugin allows sorting, filtering, and pagination on your data.
Here's an example screen from the project we will build in this chapter. The data is from a database of cities of the world, filtered to find out if there is any place called nowhere in the world:
Get your copy of DataTables
from http://www.datatables.net/, and extract it into the directory datatables
, which is in the same directory as the jquery.min.js
file.
What the DataTables
plugin does is take a large table, paginate it, and allow the columns to be ordered, and the cells to be filtered...