How to use “OR” while searching in datatables js

If you want to search for any of multiple strings in datatables , you can use the regex option, here is an example

 table.columns( 3 ).search('string A| String B', true, false).draw();

3 is the index of the column you want to search

String A, String B are the 2 strings you want to search any of them

true: to indicate that you want to use regex

false : tell datatables not to use smart search option as it uses regex and may conflict with the regex you are using

Leave a Reply

Your email address will not be published. Required fields are marked *