Reputation: 805
In Kendo Grid how to pass additional data from javascript to Read Action if I'm using Server binding.
.DataSource(dataSource => dataSource
.Server()
.Sort(sort => sort.Add(o => o.MaxDelay).Descending())
.PageSize(500))
When I use Ajax binding the option is there, fetchParameter is the javascript function.
.Read(read => read.Action("Load", "Home").Data("fetchParameter"))
The documentation only provides a way to hardcore these parameters : https://docs.telerik.com/aspnet-mvc/helpers/grid/binding/server-binding#configuration-Pass
I've checked online all the answers online are for Ajax binding.
Upvotes: 1
Views: 650
Reputation: 2110
Unfortunately you can't pass additionnal data using JavaScript to the Read action when the grid is using server binding. This is because the grid is generated and the data is fetch only once when the view is rendered server-side before client code (JavaScript) can be executed. To pass additional data using JavaScript you must use Ajax binding.
Upvotes: 1