Pass server side variables to Ajax() datasource binding for Kendo Grid
Current, if one were to use the Kendo Grid in UI for MVC, there's no way to bind the datasource using Ajax binding and specify server side parameters to the read function in the controller.
In many cases, the read function on the controller side will use a primary key to do a select statement to get particular details of a model to render.
However, when we have an array of grids, and an array of primary keys for the grids, this is very difficult to keep track of which read function corresponds to which grid.
@foreach(var modelID in Model.ModelIDs)
var readFunction = "function modelStatsReadData_" + modelID + "()";
} @*end foreach loop*@
@foreach(var model in Model.Models)
.DataSource(dataSource => dataSource
model.Id(m => m.ID);
.Read(read => read.Action("FlowPlanDetails_Read", "SubmitFlow").Data("flowPlanReadData_" + @model.D))
This is solvable if we do server side binding for the datasource, as we can pass route values. But that is an entirely different implementation and we shouldn't have choose Ajax() versus Server() binding based on how functional the API is.