My goal is to do a dynamic filter on my jqGrid. The expression looks like : (A OR B) AND ( C OR D OR E ) AND ... So, I created a global filter, with the "AND" clause and sub-groups with "OR".
The code:
var globalFilter = { groupOp: "AND", rules: [], groups: []};
var filter1 = { groupOp: "OR", rules: []};
<#list listFilter1 as filter1>
filter1.rules.push({field:"filterName1",op:"eq",data:filter1.name});
</#list>
var filter2 = { groupOp: "OR", rules: []};
<#list listFilter2 as filter2>
filter2.rules.push({field:"filterName2",op:"eq",data:filter2.name});
</#list>
var filter3 = { groupOp: "OR", rules: []};
<#list listFilter3 as filter3>
filter3.rules.push({field:"filterName3",op:"eq",data:filter3.name});
</#list>
globalFilter.groups.push(filter1);
globalFilter.groups.push(filter2);
globalFilter.groups.push(filter3);
Finally, when I have a clause like "A AND B", it works well, but when the sub groups have more than one rules it doesn't. I have the impression that there is an OR between all the conditions. How can explain it ?
Thanks in advance for your help,