This jQuery plug-in is an add-on for mottie's tablesorter plug-in, more explicitly its pager add-on. It programmatically adds pager controls below a table and applies the pager add-on for large HTML tables, so that you don't have to insert the controls to the HTML manually any more.
Motivation
The “normal” usage of the tablesorter's pager add-on requires you to manually create a user interface (control buttons to skip pages, page size selection and page display) in your HTML document (in addition to the table).
When calling the tablesorterPager
plug-in, you may then “connect” these controls with the pager by setting corresponding options to the classes of the controls. This way, the plug-in is “wired” to your controls and adds the application logic to your UI.
While that is a clear separation of logic (in javascript) and user interface (in HTML) and offers you great freedom of UI design, I personally was looking for a solution which (just like the main tablesorter
functionality) is directly applicable to any table in my web application's output without requiring the web app itself to include controls into its output.
So, the goal of this plug-in is to get rid of pager-specific HTML mark-up in the document. If you, too, want to dynamically apply a table sorter and pager to one or more tables inside some HTML document via JavaScript, while the HTML really only holds the data table, have a look at this plug-in.
Please refer to the GitHub page (README) for more detailed information.
Am I allowed to get a copy and use it even in a commercial project?
The answer's a „Yes, but…“! This open source software may even be used commercially without charge, as long as you accept and follow the license terms.
Where do I get it?
GitHub
You can download the complete project package from GitHub,
consisting of source JavaScript code (maintainable, human-readable code with documentory comments) as well as the
minified script (for production use) along with the demo page and README.
Usually, you won't need to use a Git client: simply use the “Download ZIP” button on the right of the GitHub project page.
Unzip the file, and you'll find the minified JavaScript files in directory js/min
.
Please note: Only the master
branch in GitHub contains stable releases you should download! Any other branches
are unstable feature branches under development!
NPM
This plug-in has been published as npm module.
If you have Node.js installed, you can simply use the npm
package manager
from your command line to download the module to your current working directory by calling:
npm install tablesorter-pagercontrols