Default Filter is wrong?

Default Filter is wrong?

KVDKVD Posts: 3Questions: 0Answers: 0
edited April 2013 in DataTables 1.8
Hello,

I have a table generated by DataTables 1.8.2, where I've added filtering to some columns.
One of the columns contains eg "P 1", "P10, "P 2" etc.

When I enter "P 1" in the column filter, it will return all rows that have "P 1" AND "P10".
That doesn't seem right?
It should only return the rows that have "P 1" in the column.

Is this a bug, or is it expected behaviour (why?) ?

Thanks in advance,
Kurt

Replies

  • KVDKVD Posts: 3Questions: 0Answers: 0
    Just upgraded the script to DataTables 1.9.4, and I still see the same problem.

    Can someone confirm that this is how it should work?
    How can I fix this behaviour, if I filter on "P 1" it shouldn't return "P10".
  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    Disable smart filtering. DataTables is splitting your input to search for both "P" and "1" - if both are found anywhere in the row then the row is returned as valid.

    Allan
  • KVDKVD Posts: 3Questions: 0Answers: 0
    Thanks, that makes it work as expexcted now :)
This discussion has been closed.