I am using the jQuery plugin called DataTables and I would like to display a table, that is populated automatically from an Ajax source, that supports pagination. The problem is that, from the server, I only get 10 results out of all the results (the response also contains the total number of results). Therefore the pagination looks something like : showing 1 to 10 out of 10 results.
I want it to say : showing 1 to 10 out of X results, where X is the total number of results. I cannot use any server side processing. So my question is :
How can I configure the DataTables plugin, to use this type of pagination ?
For example something like :
jQuery(table).dataTable({
"aoColumnDefs": [...],
"bProcessing" : true,
"sAjaxSource" : "...",
"sAjaxDataProp" : "...",
"sOffsetParam" : "offset",
"sNumFoundParam" : "totalResults"
});
Once again, I am restricted on working only on the client-side.
I managed to find a partial response :
If I set the "bServerSide" flag to TRUE, the plugin will look inside the server response for the fields required to build the pagination system. However, the field names are still hardcoded, so I still need a way to use custom field names. Also, the offset is sent using the "sEcho" parameter (which indicates the number of the page that is required).