vedmack / yadcf

Yet Another DataTables Column Filter (yadcf)
http://yadcf-showcase.appspot.com/
MIT License
732 stars 285 forks source link

Column filter - strict search #653

Closed 4wk- closed 3 years ago

4wk- commented 3 years ago

Hello,

When using YAFCF on a table containing the string "active" in the <td>, the <select> filter is not working properly.

I've done my best to narrow it down: https://jsfiddle.net/r0v67p2o/2/
As you can see, all filter are working fine, except for the "active" string. It's nothing to do with the string "active", it's because the search appear to be "wildcarded" (searching "active" will display "inactive" as well).

I've done the same test with only Datatable, in order to confirm that this bug was indeed on YADCF side: https://jsfiddle.net/xh6q9gpv/1/

Let me know if I can help. Thank you.

EDIT: old title: Column filter not working for a specific string "active"

4wk- commented 3 years ago

.. I just had an epiphany after writing this. The issue is not with the word "active", it's just that the search is not "strict", so "inactive" is displayed too when choosing "active". I'm editing the issue, sorry.

I there any way to tell YADCF to do a strict search? Just like the Datatable example.

vedmack commented 3 years ago

Hi

Try filter_match_mode: 'exact '

  • filter_match_mode Required: false Type: String Default value: contains Possible values: contains / exact / startsWith / regex Description: Allows to control the matching mode of the filter (supported in select / auto_complete / text filters)

Please close the ticket if it solves your issue