- I have a jQuery dataTable which I use to search for a month like this:
table.column(1).search("February").draw();
- I would like to pass 2 months as filter now but this does not work:
table.column(1).search(["Ferbrary", "March"]).draw();
- Also,
searchreturns anDataTables.APIobject as per the documentation - https://datatables.net/reference/api/search()
Is there anyway we can add 2 DataTables.API objects and invoke a draw() on the combination? I tried this and it didn't work:
filtered_table = table.column(1).search("February") + table.column(1).search("March");
filtered_table.draw();
- This link jQuery DataTables filter rows based on multiple values says we can use a different function
fnFilterinstead ofsearchto search multiple values using regex.
As per the suggestion in the above link, I tried these and none worked:
table.fnFilter("^February\$|^March\$", 1, true, false, false, false).draw();
table.fnFilter("February|March", 1, true, false, false, false).draw();
How do I achieve multiple value filters on the same column? Pls help!