Understanding 'sInfoFiltered' & the difference between _TOTAL_ vs. _MAX_

Understanding 'sInfoFiltered' & the difference between _TOTAL_ vs. _MAX_

justStevejustSteve Posts: 49Questions: 8Answers: 1
edited October 2011 in General
I need to understand under what condition the _TOTAL_ and _MAX_ values wouldn't be identical.

also - as regards the '(filtered from x total entries)' string comes from the 'sInfoFiltered' value]

I have a table where a searchbox can be (but isn't always) used to filter records. However, the 'sInfoFiltered' string is rendering at all times - even when my search filter is not employed. That shouldn't be, should it? The '(filtered from x total entries)' should be non-visible unless filtering is actually taking place?.

I need to eliminate the '(filtered from x total entries)' string except when the users have entered something in the search box. So, what value is my server returning that convinces DT there's a filter is being applied.

thx

Replies

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    _MAX_ is the total number of records in the complete data set, regardless of paging and filtering
    _TOTAL_ is the total number of records in the data set, regardless of paging, but including filtering

    > However, the 'sInfoFiltered' string is rendering at all times

    Are you using server-side processing? My guess is you are returning iTotalDisplayRecords as the number of records on a single page, not the number in the data set (taking into account filtering). If you have no filtering applied then iTotalRecords and iTotalDisplayRecords _must_ be the same: http://datatables.net/usage/server-side

    Allan
This discussion has been closed.