I have an editable kendo grid that submits to my API just fine. The update is using a popup control. When I click the update button, the update occurs and the API returns a status 200 with a location header and no content.
However, the popup control never goes away. I can X out of the popup and then refresh the grid and it refreshes with the updated data.
I am using a RESTful API that submits updates using the PUT verb. I tried in multiple browsers and with multiple forms of editable grid (popup, inline) with similar results.
Please advise.
Below is my razor grid definition
<script>
$(document).ready(function () {
var controller = "ServicePrototypes/"
var crudServiceBaseUrl = "http://localhost:3499/api/",
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: crudServiceBaseUrl + controller,
dataType: "json"
},
update: {
url: function (e) {
return crudServiceBaseUrl + controller + e.ServicePrototypeID
},
contentType:"application/json",
dataType: "json",
type: "PUT"
},
//destroy: {
// url: crudServiceBaseUrl + controller + "/Destroy",
// dataType: "json"
//},
create: {
url: function (e) {
return crudServiceBaseUrl + controller
},
dataType: "json",
contentType: "application/json",
type: "PUT"
},
parameterMap: function (options) {
return JSON.stringify(options);
}
},
pageSize: 20,
schema: {
model: {
id: "ServicePrototypeID",
fields: {
ServicePrototypeID: { type :"string" },
ServiceID: { validation: { required: true } },
Service: { validation: { required: true } }
}
}
}
});
$("#grid").kendoGrid({
dataSource: dataSource,
pageable: true,
height: 550,
toolbar: ["create"],
columns: [
"Service",
{ field: "ServiceID", title: "Service ID" },
{ command: ["edit", "destroy"], title: " ", width: "250px" }],
editable: "popup",
sortable: true
});
});
</script>