I have an Grid using paging and Ajax. I want to add a button, which when clicked causes the grid to be filtered. I added the code below:
This causes the grid to make two calls to my Ajax resource. In the first call, the correct filter is passed and the grid briefly shows the correct filtering in the browser. Then a second call happens without my filter and the grid goes back to having no filters applied to it.
$(function () { var grid = $("#grid").data("kendoGrid"); var dataSource = grid.dataSource; var button = $("#myButton"); button$("#myButton").click(function (e) { dataSource.filter( { "field": "Name", "operator": "eq", "value": "Bob Hoskins" }); });})This causes the grid to make two calls to my Ajax resource. In the first call, the correct filter is passed and the grid briefly shows the correct filtering in the browser. Then a second call happens without my filter and the grid goes back to having no filters applied to it.