我只想问是否有人知道如何在按钮单击时将剑道网格设置为可编辑的真或假。?如果将网格设置为 false,我可以将其设置为可编辑的 true,但是我无法将其设置回可编辑的 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
});
});