Author Topic: How to filter with mixed "and" and "or"  (Read 349 times)

lyassa

  • Newbie
  • *
  • Posts: 4
    • View Profile
How to filter with mixed "and" and "or"
« on: October 08, 2023, 12:29:02 pm »
How can I filter the grid on a condition that needs both "and" and "or"? For example:
status = "New" AND (firstName contain "john" OR lastName contain "john" OR companyName contain "john")

I played with filterModel: { on: true, mode : "OR"}  and filterModel: { on: true, mode : "AND"} but couldn't get it to work.  Any advice is greatly appreciated.

Thank you

lyassa

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: How to filter with mixed "and" and "or"
« Reply #1 on: October 12, 2023, 01:49:04 am »
Looks like mixing ANDs and ORs is not possible. I ended up filtering the dataModel and refresh the grid. Doing it that way is a lot more flexible than using the built in filter method.