which should return any rows where ID = 1 OR ID = 4.
1 Answer, 1 is accepted
0
Accepted
Martin Yankov
Telerik team
answered on 20 Jun 2013, 07:28 AM
Hi Zac,
The DataSource filter property takes an array of filter expressions like the one you used, except the filter value must match the value of the filtered field. In your case the "ID" field is probably a single number and it does not equal an array of numbers. Each filter expression must be set as a separate JavaScript object in an array:
grid.dataSource.filter = [
{ field: "ID", operator: "eq", value: 1 },
{ field: "ID", operator: "eq", value: 4 }
];
The default filter logic operator is "and". If you want to change the logic operator, you will have to set the logic option of the filter property to "or" and assign the filter array to the filters option:
grid.dataSource.filter = {
logic: "or",
filters: [
{ field: "ID", operator: "eq", value: 1 },
{ field: "ID", operator: "eq", value: 4 }
]
};
I hope this helps. Let me know if you need any further assistance.
Regards,
Martin Yankov
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.