Including and excluding expression at once
Including and excluding expression at once
Hello,
I am trying to make datatable filter with two inputs in each th cell, where one input should work as usual - filter rows which contains entered expression and second input should exclude rows that contains this expression.
For example I have table which contains three rows - "Ford Mustang", "Ford Focus" and "Ford Mondeo". In first input I will write "Ford" and in second "Mustang". The datatable should show all Ford cars which are not Ford Mustang.
Is it possible with datatables?
Thank you for your help!
This question has an accepted answers - jump to answer
Answers
Two options:
column().search()
method, orAllan
Hello Allan,
thank you for your response. Can you please provide more information about the first option? How can i exclude for example expression "mustang"?
Thank you very much!
This little example shows a regex being used to search for rows that do not contain "Ashton".
Allan
Thank you very much Allan.