When I am calling a serverside DataTables search, I get back one item and this is the response of the AJAX call:
{draw: 1, recordsTotal: 1, recordsFiltered: 18,…}
data: [{...}]
draw: 1
recordsFiltered: 18
recordsTotal: 1
And DataTables recognizes this:
Showing 1 to 10 of 18 entries (filtered from 1 total entries)
This is my current configuration (I'm currently using pipelining as described here: https://datatables.net/examples/server_side/pipeline.html)
var table = $('#table').DataTable({
"processing": true,
"serverSide": true,
"ajax": $.fn.dataTable.pipeline({
url: '/url',
pages: 5 // number of pages to cache,
}),
"pagingType": "full_numbers",
"columns": columnData,
"order": [[1, "desc"]]
});
When I call table.page.info() in the Chrome browser console, I get
{page: 0, pages: 2, start: 0, end: 10, length: 10, …}
end: 10
length: 10
page: 0
pages: 2
recordsDisplay: 18
recordsTotal: 1
serverSide: true
start: 0
Based on the previous information and the fact that Datatables correctly searches, I think my server-side implementation is correct. However, I don't know what is causing Datatables to display two pages instead of one with ten records per page.