Is it possible to do custom filtering where I combine a group of filters as ORs, but then they are ANDed with other filters
Example:
If( (LastName contains "ush" OR FirstName contains "ush") && (Age > 40) )
Hello rsimm,
Thank you for posting in the community.
I believe you might consider Advanced filtering feature helpful for achieving your requirement. When advanced filtering is configured then advanced filtering button is rendered next to the column header text. Once the advanced button is clicked, the "advanced" filtering dialog appear where more complex filtering conditions are available to the user. The advanced filtering dialog expose "AND" or "OR" operations in order to combine multiple filters. It allows multiple filters to be applied for a single column. However, with advanced filtering you could select whether the matching records should match all of the conditions or any of them.
A sample project illustrating Advanced filtering could be found at:
http://igniteui.com/grid/filtering
Additionally, we have an article in our documentation describing filtering in details and it could be found at:
http://www.infragistics.com/help/jquery/iggrid_filtering.html
I hope you find my information helpful.
Please let me know if you need any further assistance with this matter
Thank you for your reply. I am aware of the Advanced Filtering, but as you stated it appears to only allow for you to do all ANDs or all ORs. I want to be able to logically group some filters into ORs and other's as ANDs within the same filter command as my example demonstrates:
Logic: If( (LastName contains "ush" OR FirstName contains "ush") AND (Age > 40 OR Age < 30) )
Javacsript:
$("#grid1").igGridFiltering('filter', ([
"#grid1"
'filter'
{ fieldName: "LastName", expr: "ush", cond: "contains", logic: "OR"},
"LastName"
"contains", logic: "OR"
{ fieldName: "FirstName", expr: "ush", cond: "contains", logic: "OR"},
"FirstName"
// How can I logically fit an AND in here while grouping the others as ORs
{ fieldName: "Age", expr: 40, cond: "greaterThan", logic: "OR"},
"Age"
"greaterThan", logic: "OR"
{ fieldName: "Age", expr: 30, cond: "lessThan", logic: "OR"}
"lessThan", logic: "OR"
]));