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_2018beginner_2018 Posts: 46Questions: 19Answers: 0
edited May 2018 in Free community support

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

Answers

  • kthorngrenkthorngren Posts: 20,140Questions: 26Answers: 4,735
    edited May 2018

    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

  • beginner_2018beginner_2018 Posts: 46Questions: 19Answers: 0

    Kevin Sir,

    Request you to please kindly extend your support b providing the updated fiddle URL.
    Seems you missed providing updated URL

  • kthorngrenkthorngren Posts: 20,140Questions: 26Answers: 4,735
    Answer ✓

    Sorry, forgot to save it originally. See if this is works:
    https://jsfiddle.net/8soz64df/1/

    Kevin

  • beginner_2018beginner_2018 Posts: 46Questions: 19Answers: 0
    edited May 2018

    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

  • termiNadertermiNader Posts: 2Questions: 0Answers: 0

    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?

  • kthorngrenkthorngren Posts: 20,140Questions: 26Answers: 4,735
    edited June 2018

    Sounds like this thread posted today is similar to your question. Do you build your select inputs within the initComplete option?

    Kevin

  • termiNadertermiNader Posts: 2Questions: 0Answers: 0

    That was my issue. Working now, thanks!

This discussion has been closed.