Issue with Next button when using Server Side processing

Issue with Next button when using Server Side processing

ashimashiashimashi Posts: 7Questions: 0Answers: 0
edited August 2011 in General
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?

Replies

  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    http://www.datatables.net/usage/server-side
    [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)
  • ashimashiashimashi Posts: 7Questions: 0Answers: 0
    Thanks fbas, that was exactly the case. The difference in those is quite subtle, thanks for pointing it out.
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    You're welcome. Glad you got it figured out.
This discussion has been closed.