I am trying to filter datasource on multiple fields. I have a Kendo Multi filter checkbox option on my grid. I initialize every Kendo multi filter for every column.
After that I apply a filter using a javascipt function like this and I set the data of the grid as the filtered data.
function filterGrid() {
var grid = $("#grid").data('kendoGrid');
var filter = [];
filter.push({ field: "ratingPlace", operator: "startswith", value: "US" });
grid.dataSource.filter(filter);
grid.dataSource.data(grid.dataSource.view());
}
So the function applies a filter to the grid. now when iI click the Kendo multi filter option, all the data in the old datasource appears in the filter list.
How can I avoid this? I need only the filtered data to be available only in the filtered list rather than the entire dataSource items. I do not have this issue when I initialize the Kendo multiple checkbox filter after executing the filterGrid() function. Is there any way to re-initialize the source of the ("kendoFilterMultiCheck") of each column?? I have attached a jsfiddle example to demonstrate the same.
1) first initialize all the filter multi checkbox by clicking on column header with initial dataSource 2) click on filter button 3) dataSource is replaced 4) click on filter multi check with new dataSource - old filter data appears in list