searching for null values

searching for null values

daudodaudo Posts: 13Questions: 6Answers: 1

Hi,

I am trying to create an initial search filter that matches if the second field of the table has null values:

searchCols: [
        null,
        { search: null }
]

That however produces the following exception: "Uncaught TypeError: Cannot read property 'replace' of null"

If I change to { search: "" } then no exception occurs, but this does not match explicit null values.

Any ideas?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Answer ✓

    Currently DataTables built in search is entirely string based - which is why you are getting an error there. If you want to search for null exactly then you would need to use a custom plug-in search function.

    Allan

  • daudodaudo Posts: 13Questions: 6Answers: 1

    yes, you are right, I complete forgot about custom search plugins!

    Thanks!

This discussion has been closed.