Unable to filter null values using (select inputs) filter drop-down for Datatable
Unable to filter null values using (select inputs) filter drop-down for Datatable
beginner_2018
Posts: 46Questions: 19Answers: 0
Dear All,
I have data table where it's working perfectly fine. But I need to filter the data table column even for null values.
And I also need to display the value "Empty" or "Null" in (Select) filter drop-down to filter the Data Table column having null values.
If you see below I have blank value in drop-down which indicates the column is having null values.
Fiddle
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I would use
columns.render
to create the desired value to filter for null data using Orthogonal Data. I updated your example here:https://jsfiddle.net/8soz64df/
I also updated the loop building the options to add '(Empty)`, which matches the null filter value in columns.render,
Kevin
Kevin Sir,
Request you to please kindly extend your support b providing the updated fiddle URL.
Seems you missed providing updated URL
Sorry, forgot to save it originally. See if this is works:
https://jsfiddle.net/8soz64df/1/
Kevin
Sir,
Thank you very much.
I had added updated the fiddle for columnDefs to use for multiple columns , So that it can help others to apply for multiple columns
Hi, thanks for this discussion...I'm having a similar issue.
I would like to use the solution provided, but it does not work when my data is provided by an AJAX source (with no server-side processing). I just get the filter drop down boxes with nothing to select inside. Any ideas?
Sounds like this thread posted today is similar to your question. Do you build your select inputs within the
initComplete
option?Kevin
That was my issue. Working now, thanks!