Searching for booleans (not working?!)
Searching for booleans (not working?!)
datacollect
Posts: 6Questions: 4Answers: 0
Hi,
I'm trying to search a column (local no server-side) for boolean values (no strings).
mergedDevicesListDataTable
.column( 0 )
.search( true )
.draw();
It always returns an empty result set.
Searching the boolean column by string ("true"/"false") is not working either.
Searching other (non-boolean) columns in the same table is working perfectly.
Any idea?
Thanks.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Searching for
'true'
should work - I've just created this little example to show it working. If you are using server-side processing, it won't work since the filtering is done at the server-side.The reason it needs to be a string for the default filter is that DataTables converts the filtering values to be strings. This is a limitation in the current code base that I plan to resolve in the next major release.
You could use a custom plug-in filter if you do need to search for boolean true.
Allan
Ok. Got it now.
I am rendering the booleans to a custom string (using columns.render) and didn't constrained it to "type == 'display'". This was new to me.
Thank you for your answer.