Private Social Media
Try out 'Friends and Family' - FnF, an alternative system for use by private groups.
Simple installation designed to work with shared hostings.
No advertising, no annoying notifications.
Getting Started with jQuery DatatablesIf you're reading this then you are presumably already including jquery.js in your pages, so you might also be interested to read my notes on Getting Started with jQuery Plugins.
Introduction.I started using jQuery.Datatables recently, and was dissapointed with the getting started documentation. Among other things, this says "DataTables has most features enabled by default, so all you need to do to use it with one of your own tables is to call the construction function (as shown below)." Below is shown:
So lets follow the recipe. The simplest I'm going to try is:
You can see the result in dt102. The top elements now bear a sensible relationship to the examples. The bottom elements are problematic, since we can only see one of them. By analogy we can add a class to deal with the info. This is the one from the example CSS file:
But looking at the DOM, we see that the second bottom DIV has two classes. The second is in another CSS file. In my attempt at working classes I have added a height for class dataTables_paginate, and minimized paging_two_button:
The result, dt103, still doesn't show anything related to pagination. This is because what should be shown depends on background images.These are accurately described in one of the supplied CSS files, so we add:
At this point, ensure that the images from the distribution are in the correct place. In my example thet should be in the same folder. Then you should see the forward and back buttons as in dt104. So then, the only missing item is the sort indications on the column headers. If I use the out-of-box background styles that implement these, they appear behind the column name, so instead I used:
And there you have it. At that point the demo, dt105, displays most of the Datatables functionality setting aside loading from the server via AJAX - which is quite straightforward, and server-side processing, which I have not tried. Also at that point, you should have a much better idea of how to work with Datatables - "Some styling required".