I'm not really sure where to post this or if it is of use/ relevant - so apologies if this is in the wrong place
I searched the forum earlier because I was wanting to find a way to do this - but not finding anything, I read through the guides and kendo docs and came up with a solution.
The problem:
In some instances, I need to "pre" filter a query - for example, I want to show only active records when a query is first displayed - but I want the user to be able to override this if they need to - so a where clause is out, and I really don't want to create a separate query for active/inactive etc
The solution:
This is a render script to be used on the query:
var grid = widget;
var ds=grid.dataSource;
ds.filter( {
logic: "and",
filters: [
{field: "fieldName", operator: "operator - eg eq/neq ... ", value: "value" },
{field: "IsActive", operator: "eq", value: "Yes" }
]
});
Hopefully I've given enough detail to help you understand what I'm saying
One final note - I found that the abbreviated versions of the operators - ie eq as opposed to equals, seem to work better, although there was a bit of trial and error getting all the format right so I should probably test that again.
Hope someone finds it useful