I have a kendo datasource for which the data needs to be filtered by the selected month. Can a custom filter be applied to the datasource to achieve the same?
My datasource looks somewhat like this:
new kendo.data.DataSource({
data: [{name:"Bill", dob:"01/02/1980"},
{name:"Bob", dob:"05/06/1981"},
{name:"Johnny", dob:"01/08/1980"},
{name:"James", dob:"09/10/1989"}]
});
The dates are converted to string in the format mm/dd/yyyy
I need to apply a filter so as to retrieve the two records whose dob is on Jan 1980 here.
You can try applying a complex filter as in this code:
filter: { logic: "and", filters: [ {field: "dob", operator: "contains", value: "01"}, {field: "dob", operator: "contains", value: "1980"} ] }
Here you can find a sample dojo page.