column filter number error
column filter number error
skygod35
Posts: 2Questions: 1Answers: 0
I am using this column filtering code
https://datatables.net/extensions/fixedheader/examples/options/columnFiltering.html
I'm having trouble searching for the same numbers in the table
eg : "1" - "11" - "111"
I search for the number "1" but I come across the numbers "11" "111"
how can i fix this?
This discussion has been closed.
Answers
You'd need to use an exact match regular expression. By default we match on any part of the string, but if you were to use
^1$
then it will do an exact match.Allan
how can i use this in code
Start by reading about the different search modes in the
search()
docs. The same is true forcolumn().search()
. The example you linked to uses this:You will want to prefix the search value with
^
and postfix with$
. Change line 5 to look like this:Kevin