[英]Update event in Kendo Grid is not firing
This is my script 这是我的剧本
$(document).ready(function () {
dataSource = new kendo.data.DataSource({
transport: {
read:
{
url: "http://dnndev.me:80/DesktopModules/ServicePoint/api/DropData/Drop",
dataType: "json",
},
destroy:
{
url: "http://dnndev.me/DesktopModules/ServicePoint/api/DeleteCategory/DeleteCategorybyid",
type: "DELETE"
},
update:
{
url: "http://dnndev.me:80/DesktopModules/ServicePoint/api/updateCategory/update",
type: "POST",
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return {
models: kendo.stringify(options.models)
};
}
}
},
},
schema:
{
model:
{
id: "CategoryID",
fields: {
CategoryID: { editable: false, nullable: true, type: "number" },
CategoryName: { editable: true, nullable: true, type: "string" },
}
}
}
});
$("#grid1").kendoGrid({
dataSource:dataSource,
editable: "inline",
columns: [
{
field: "CategoryID",
title: "number",
},
{
field: "CategoryName",
title: "Name"
},
{
command: ["edit",
{
name: "destroy",
text: "remove",
}
],
}
],
height: "500px",
pageable: {
refresh: true,
pageSizes: true,
buttonCount: 5
},
}).data("kendoGrid");
});
The read and destroy operation are working fine but while doing the update it's not even firing the URL(cross checked with Inspect element),as well as I checked my service in POSTMAN it is working fine. 读取和销毁操作工作正常,但是在进行更新时,它甚至没有触发URL(与Inspect元素进行交叉检查),以及我在POSTMAN中检查服务时都工作正常。
Remove , from 从......中去除
type: "POST",
should be 应该
update:{
url: "http://dnndev.me:80/DesktopModules/ServicePoint/api/updateCategory/update",
type: "POST"
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.