multiple search by using Comma (individual Column Search)
multiple search by using Comma (individual Column Search)
Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
This discussion has been closed.
Answers
Hi every one ,
I went through this https://datatables.net/extensions/fixedheader/examples/options/columnFiltering.html
for Individual column search ,that is working fine .
How can I search with (,)Comma with multiple values .
For Instance In
AGEcolumn there is search option is there ,In that I can search with single value like47but how can I search with mutlipe values at time by usingcomma(,) like
47,41I should get all 47 values and 41 values .Like this I need all the columnsPlease help on it .
Thanks
Sandeep
You will need to use a regex expression. Instead of
47,41you will need to use47|41. Try this example. Type47|41in the Age column and turn on regex and turn off smart search. You should see all rows with either value.See the
search()and ``-api column().search()docs for more details. If you want the users to use,instead of|you will need to add a regex replace() statement in the click event to replace all the,with|`. See the last example in this thread for an example.Kevin
@kthorngren Thank you so much for your valuable response and time ,
as expected it is showing but I got one more challege ,is it posible to search range wise like if I search
41|47on individualAGEcoulmn ,It should giveAGEbetween41to47like41,42,43,44,45,46,47all this records need to display ,This is So appriciated and help on it please
Thanks
Sandeep
This example shows how to do a range search.
Kevin