Issue with Next button when using Server Side processing
Issue with Next button when using Server Side processing
Hi,
I'm using datatables with a server side data source (a Java servlet). The servlet takes the search parameter and start row / max row, creates a (limit) query to get the required data, and also returns the total number of records prior to filtering, pretty much identical to the example given for php.
However, in rendered table I always get something like:
Showing 1 to 10 of 10 entries (filtered from 13,831 total entries)
and Next button is disabled.
Why does it think there's only 10 entries? This is with no entry for search string. Am I returning something wrong? I'm returning 10 as total iTotalDisplayRecords, and 13831 as iTotalRecords, and 10 rows of aaData from servlet.
Any ideas?
I'm using datatables with a server side data source (a Java servlet). The servlet takes the search parameter and start row / max row, creates a (limit) query to get the required data, and also returns the total number of records prior to filtering, pretty much identical to the example given for php.
However, in rendered table I always get something like:
Showing 1 to 10 of 10 entries (filtered from 13,831 total entries)
and Next button is disabled.
Why does it think there's only 10 entries? This is with no entry for search string. Am I returning something wrong? I'm returning 10 as total iTotalDisplayRecords, and 13831 as iTotalRecords, and 10 rows of aaData from servlet.
Any ideas?
This discussion has been closed.
Replies
[quote]int iTotalRecords Total records, before filtering (i.e. the total number of records in the database)
int iTotalDisplayRecords Total records, after filtering (i.e. the total number of records after filtering has been applied - not just the number of records being returned in this result set)[/quote]
if you have no sSearch or other items in your WHERE clause, the iTotalRecords and iTotalDisplay records should be the same (13831).
you don't actually have to return the count of rows you are returning (your LIMIT length)