我在我的网站中使用Kendo UI网格和内联编辑。 网格正在显示行。但是当我点击编辑按钮时它什么也没做。 它不会调用任何函数,并且字段不会更改为可编辑。 下面是我的代码:
$(document).ready(function () {
var orderId=$("#OrderId").val();
var datasource = new kendo.data.DataSource({
transport: {
type: "GET",
read: {
url: "/Order/GetOrderItems?OrderId=" + orderId,
contentType: "application/json; charset=utf-8",
dataType: "json"
},
update: {
url: "/Order/UpdateOrderItemStatus",
dataType: "json",
type: "PUT"
}
},
schema: {
model: {
id: "OrderItemId"
}
}
});
datasource.fetch(function () {
var data = datasource.at(0);
console.log(data);
console.log(datasource);
});
$("#orderItems-grid").kendoGrid({
dataSource: datasource,
columns: [{
field: "Orderref",
title: "Order Ref"
}, {
field: "ProductRef",
title: "Product Ref"
}, {
field: "ProductNotes",
title: "Product Notes"
}, {
field: "OrderStatusId",
title: "Order Status"
},
{ command: "Edit" }],
editable: "inline"
});
});