I've been using the Grid successfully to implement paging, sorting, filtering via server-side POSTs, it all works great. However, I am having trouble getting the DELETE buttons (and possibly UPDATE as well) to immediately post, it seems like the control is waiting/batching them up... and I don't want that behavior. I want immediate POSTs for delete and update.
Can anyone see where I'm going wrong here?
Thanks,
Craig
<script type="text/javascript">
$(function () {
$("#employeesGrid").kendoGrid({
toolbar: ["create", "save", "cancel"],
columns: [
{ field: "FirstName", title: "First Name" },
{ field: "LastName", title: "Last Name" },
{ command: "destroy" }
],
dataSource: new kendo.data.DataSource({
transport: {
read: {
url: "api/Customer",
type: "POST",
contentType: "application/json"
},
destroy: {
url: "api/Customer/Delete",
type: "POST"
//contentType: "application/json"
},
parameterMap: function (options, operation) {
if (operation === "read")
return kendo.stringify(options);
else
return options;
}
},
schema: { data: "Data", total: "Count", model: { id: "Id"} },
pageSize: 5,
serverPaging: true,
serverSorting: true,
error: function (e) {
console.log(e.statusText);
}
}),
batch: false,
editable: {
//mode: "popup",
destroy: true
},
scrollable: false,
sortable: true,
pageable: true
});
});
</script>
Can anyone see where I'm going wrong here?
Thanks,
Craig
<script type="text/javascript">
$(function () {
$("#employeesGrid").kendoGrid({
toolbar: ["create", "save", "cancel"],
columns: [
{ field: "FirstName", title: "First Name" },
{ field: "LastName", title: "Last Name" },
{ command: "destroy" }
],
dataSource: new kendo.data.DataSource({
transport: {
read: {
url: "api/Customer",
type: "POST",
contentType: "application/json"
},
destroy: {
url: "api/Customer/Delete",
type: "POST"
//contentType: "application/json"
},
parameterMap: function (options, operation) {
if (operation === "read")
return kendo.stringify(options);
else
return options;
}
},
schema: { data: "Data", total: "Count", model: { id: "Id"} },
pageSize: 5,
serverPaging: true,
serverSorting: true,
error: function (e) {
console.log(e.statusText);
}
}),
batch: false,
editable: {
//mode: "popup",
destroy: true
},
scrollable: false,
sortable: true,
pageable: true
});
});
</script>