我只想问一下是否有人知道如何在点击按钮时将kendo网格设置为可编辑的true或false。我可以将网格设置为可编辑的true,如果它设置为false但是,我无法将其设置回可编辑的false。非常感谢您的回复。 :)
$('.k-grid-add').on('click',function(){
$("#grid").kendoGrid({
dataSource: dataSource,
navigatable: true,
pageable: true,
height: 430,
toolbar: ["create", "save", "cancel"],
columns: [
"ProductName", {
field: "UnitPrice",
title: "Unit Price",
format: "{0:c}",
width: 110
}, {
field: "UnitsInStock",
title: "Units In Stock",
width: 110
}, {
field: "Discontinued",
width: 110
}, {
command: "destroy",
title: " ",
width: 90
}],
editable: true
});
});
$('.k-grid-cancel-changes').on('click',function(){
$("#grid").kendoGrid({
dataSource: dataSource,
navigatable: true,
pageable: true,
height: 430,
toolbar: ["create", "save", "cancel"],
columns: [
"ProductName", {
field: "UnitPrice",
title: "Unit Price",
format: "{0:c}",
width: 110
}, {
field: "UnitsInStock",
title: "Units In Stock",
width: 110
}, {
field: "Discontinued",
width: 110
}, {
command: "destroy",
title: " ",
width: 90
}],
editable: false
});
});