columnControl searchList not working for Booleans and numbers
columnControl searchList not working for Booleans and numbers
Link to test case: https://live.datatables.net/tiwevaji/1/
Description of problem:
The columnControl searchList option is not working for Boolean data types and number data types.
The test case https://live.datatables.net/tiwevaji/1/ demonstrates this issue.
| Data Type | Search Number | Search Text | Search List |
|---|---|---|---|
| Number | ✅ | ✅ | ❌ |
| Boolean | - | ✅ | ❌ |
| Text | - | ✅ | ✅ |
Observations:
The searchList correctly lists the options for all data types.
However, selecting an option from the searchList does not filter the table for Boolean and number data types.
Link to Ajax data: https://dummyjson.com/todos



This question has an accepted answers - jump to answer
Answers
Hi,
Many thanks for the test case and clear description (as before)
.
I've committed a fix and the nightly build now has the change. This is the updated example with the nightly.
It comes down to the fact that DataTables does string based search, but the conversion for where booleans (etc) become strings isn't in the right place. I've got a note to change that for DT2.4. The change in ColumnControl is a workaround for the moment.
Regards,
Allan
And thank you again for the quick fix, Allan!
Hi, Allan,
I see the update is available in the CDN download builder but not on NPM.
Could you push ColumnControl v1.0.6 to NPM?
Sorry - I just pushed a separate change and was surprised when I saw the npm publish emails coming in, then realised what I'd (not) done. It is up now.
Allan
Hi, I notice a similar issue.
The searchList only work with string, not with number or boolean value.
Is it possible to fixed it.
Example:
https://live.datatables.net/sinufixo/3/edit
I'm surprised that the numbers don't work. That is a bug that I'll look into as soon as I can (hopefully Friday).
The boolean aspect is a feature that needs to be added. I will add that when I can, or if you need it to be prioritised, support options are available.
Allan
Thanks Allan.
Let me know if you need to test or if I can help you with something
I wasn't able to reproduce the error with the numbers, which was when I realised you are using an old version of ColumnControl in your example. Updating to the latest versions of the DataTables software and extensions, allows it to work.
The boolean search also works. It isn't attractive with its
trueandfalse, but it does work.Allan