For example - a grid
@(Html.Kendo().Grid<CustomerModel>()
.Name("ExampleGrid")
.Pageable()
.Sortable()
.Groupable()
.Resizable(resize => resize.Columns(true))
.Reorderable(reorder => reorder.Columns(true))
.Columns(columns =>
{
columns.Bound(c => c.Name);
columns.Bound(c => c.System).Width(190);
columns.Bound(c => c.Principal).Width(190);
})
.DataSource(s => s
.Ajax().Read(r => r.Action("GetContacts", "Example"))
.PageSize(15))
)
is filled with data and then you want to - from the client JS - call READ so that the data is refreshed, but you want to send some parameters to the controller.
I've searched the web and and the best I can find is:
var $grid = $("#ExampleGrid").data("kendoGrid");
$grid.dataSource.read.data = viewModel;
$grid.dataSource.read();
but, even though data is set to the correct object, the object is never sent to the server (confirmed by IE F12 Developer tools Network sniffer)
So, how do you send data back to the server when you tell the grid to read?
@(Html.Kendo().Grid<CustomerModel>()
.Name("ExampleGrid")
.Pageable()
.Sortable()
.Groupable()
.Resizable(resize => resize.Columns(true))
.Reorderable(reorder => reorder.Columns(true))
.Columns(columns =>
{
columns.Bound(c => c.Name);
columns.Bound(c => c.System).Width(190);
columns.Bound(c => c.Principal).Width(190);
})
.DataSource(s => s
.Ajax().Read(r => r.Action("GetContacts", "Example"))
.PageSize(15))
)
is filled with data and then you want to - from the client JS - call READ so that the data is refreshed, but you want to send some parameters to the controller.
I've searched the web and and the best I can find is:
var $grid = $("#ExampleGrid").data("kendoGrid");
$grid.dataSource.read.data = viewModel;
$grid.dataSource.read();
but, even though data is set to the correct object, the object is never sent to the server (confirmed by IE F12 Developer tools Network sniffer)
So, how do you send data back to the server when you tell the grid to read?