I downloaded and modified the KendoGridWebAPI sample project and modified the grid to have popup editing rather than batch in line.
The api controller (ValuesController) was designed to handle collections for the update and delete operations and so I regenerated a standard api controller against the Product entity to manage updates and deletes for a single Product
The update (PUT) no longer worked complaining of a null "id" parameter ...
public HttpResponseMessage PutProduct(int id, Product product)
After changing the function to ...
public HttpResponseMessage PutProduct(Product product)
and the parameterMap from ...
parameterMap: function (data, operation) {
if (operation != "read") {
return kendo.stringify(data.models);
}
}
to ...
parameterMap: function (data, operation) {
if (operation != "read") {
return kendo.stringify(data.models[0]);
}
}
things began to work as expected.
This doesn't really follow REST protocol but how do you do a standard REST update with the ID on the path?
update: {
url: "api/values/5",
type: "PUT",
contentType: 'application/json;charset=utf-8'
},
and what should the parameterMap look like?
The api controller (ValuesController) was designed to handle collections for the update and delete operations and so I regenerated a standard api controller against the Product entity to manage updates and deletes for a single Product
The update (PUT) no longer worked complaining of a null "id" parameter ...
public HttpResponseMessage PutProduct(int id, Product product)
After changing the function to ...
public HttpResponseMessage PutProduct(Product product)
and the parameterMap from ...
parameterMap: function (data, operation) {
if (operation != "read") {
return kendo.stringify(data.models);
}
}
to ...
parameterMap: function (data, operation) {
if (operation != "read") {
return kendo.stringify(data.models[0]);
}
}
things began to work as expected.
This doesn't really follow REST protocol but how do you do a standard REST update with the ID on the path?
update: {
url: "api/values/5",
type: "PUT",
contentType: 'application/json;charset=utf-8'
},
and what should the parameterMap look like?