Reputation: 3744
@(Html.Kendo().Grid(Model.List)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.Code);
columns.Bound(p => p.Name);
})
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetList", "Home").Data("additionalData")))
)
--javascript
function additionalData() {
return { searchTerm: search }
}
I have this simple kendoui grid, my problem is it is making httppost to the controller, i need to do http get.
is there any way i can modify this? to do httpget, i've read online that the default for the grid is post, but could not find anything on this to make it a get.
Upvotes: 3
Views: 824
Reputation: 139798
You can set the HTTP verb of any of your datasource action with the Type
method on the CrudOperationBuilder
class:
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetList", "Home")
.Type(HttpVerbs.Get)
.Data("additionalData")))
Upvotes: 3