I have a little problem with the MVC datasource configuration of the grid.
I want to be able to specify a unique URL per row for the Update and Delete method of the datasource (ajax enabled).
My configuration right now looks like this:
// Removed other configurations here...
.DataSource(dataSource => dataSource
.Ajax()
// Removed other configurations here...
.Read(i => i.Route(RouteNames.ReadRoute)) // This should point to /api/users + GET
.Create(i => i.Route(RouteNames.CreateRoute).Type(HttpVerbs.Post)) // This should point to /api/users + POST
.Update(i => i.Route(RouteNames.UpdateRoute, new { id = ????? }).Type(HttpVerbs.Put)) // This should point to /api/users/{id} + PUT
.Destroy(i => i.Route(RouteNames.DeleteRoute, new { id = ????? }).Type(HttpVerbs.Delete)) // This should point to /api/users/{id} + DELETE
There seems to be some problems with Kendo not supporting REST specifications.
First of; The Read method CANNOT be a GET, it must be a POST (is this correct and why?)
Secondly, and more important; The Update and Destroy NEEDS to be in the form of /collection/{id}
So for each row, I would have different Update and Delete urls where the {id} part varies.
This can be solved if I configure the datasource using javascript by setting the url of the create and delete methods to a javascript function.
But unfortunately this isn't possible in MVC - why?
Kind regards
Richard
I want to be able to specify a unique URL per row for the Update and Delete method of the datasource (ajax enabled).
My configuration right now looks like this:
// Removed other configurations here...
.DataSource(dataSource => dataSource
.Ajax()
// Removed other configurations here...
.Read(i => i.Route(RouteNames.ReadRoute)) // This should point to /api/users + GET
.Create(i => i.Route(RouteNames.CreateRoute).Type(HttpVerbs.Post)) // This should point to /api/users + POST
.Update(i => i.Route(RouteNames.UpdateRoute, new { id = ????? }).Type(HttpVerbs.Put)) // This should point to /api/users/{id} + PUT
.Destroy(i => i.Route(RouteNames.DeleteRoute, new { id = ????? }).Type(HttpVerbs.Delete)) // This should point to /api/users/{id} + DELETE
There seems to be some problems with Kendo not supporting REST specifications.
First of; The Read method CANNOT be a GET, it must be a POST (is this correct and why?)
Secondly, and more important; The Update and Destroy NEEDS to be in the form of /collection/{id}
So for each row, I would have different Update and Delete urls where the {id} part varies.
This can be solved if I configure the datasource using javascript by setting the url of the create and delete methods to a javascript function.
But unfortunately this isn't possible in MVC - why?
Kind regards
Richard