Remove "(filtered from NaN total entries)"
Remove "(filtered from NaN total entries)"
Seb33300
Posts: 3Questions: 1Answers: 0
Hello,
I am using Datatables to render multiple tables in my application using ajax (server side processing).
But in some case, for performance reason, I don't send the recordsTotal so the "(filtered from NaN total entries)" appear below the datatable.
Is there a way to hide it only when the recordsTotal is not given? (I don't want to remove it from all my Datatables)
Ortherwise replace "NaN" by something like "unknown"?
Seb
This discussion has been closed.
Answers
Try experimenting with
infoCallback
option as shown below.See this example for code and demonstration.
See more articles about jQuery DataTables on gyrocode.com.
Thanks, but I need to keep translations (my application could be displayed in multiple languages).
Can I use texts from the translation files with this solution?
Yes, use
language.infoFiltered
to remove the_MAX_
property.Note that DataTables does expect the
recordsTotal
to be returned!Allan
I'm sorry but I'm not sure to understand.
I don't want to remove the
_MAX_
property.I am looking for a way to hide the
infoFiltered
message ifrecordsTotal
isnull
.It could be possible to add your own key to the
language
property and usei18n
method to access it in customizedinfoCallback
function.Yup -
infoCallback
is the only way to handle the case where it might be null or might be a number. However, as I noted, this is not something that DataTables expects - it is not a supported use case.Allan