Hi,
Currently I'm facing some problems while passing customn filters via js in an ajax bounded grid.
The Grid is defined identically to this:
01.@(Html.Kendo().Grid<ViewModel>()02. .Name("Grid")03. .Columns(columns =>04. {05. columns.Bound(m => m.Name)06. .Filterable(false)07. .Width(150)08. .Title("Name")09. })10. .Pageable(page => page11. .Refresh(true)12. .PageSizes(true)13. )14. .Sortable()15. .Scrollable(s => s.Enabled(true).Height("100%"))16. .DataSource(dataSource => dataSource17. .Ajax()18. .PageSize(10)19. .Read(read => read.Action("Action", "Controller", new { Area = "Area" })20. )21. )
Aftzer the Data is loaded, I want to manually pass a filter from an external function like:
1.var x = $("#Grid").data("kendoGrid");2.x.dataSource.filter({logic: "and", filter: {field: "Name", operator: "eq", value:"John"} });
The defined action of the grid is fired but the POST-Request catched via Dev-Tools doesn't contain the filter (filter ="").
The goal is to transport a costum filter during the paging and sorting. (Using Kendos Server-Side-Filtering isn't an option because
of architecture-issues)
How can i include the filter in the request or is there any other way to achieve the described goal?
Thanks.
Regards,
Matthias