我正在使用剑道网格,在编辑一行时,我正在检查该行是否可编辑。因此,如果所选行不可编辑,如何使其不可编辑。我正在执行edit
网格的签入功能。
代码
$("#grid").kendoGrid({
dataSource : ds,
selectable : "multiple",
sortable : true,
filterable : false,
reorderable: true,
scrollable : false,
toolbar : ["create"],
columns: [
{ field: "event", width: "120px", title: "Event Type"},
{ field: "event_id", width: "120px", title: "Event ID"},
{ field: "addr_no_or_type", width: "120px", title:"Address"},
{ field: "event_rate", width: "100px", title: "Rate"},
{ field: "sched_date", width: "100px", title: "Scheduled"},
{ field: "complete_date", width: "100px", title:"Completed"},
{ field: "serial_no", width: "100px", title: "Serial #"},
{ command: ["edit", "destroy"], title: "Options", width: "170px"}
],
editable: "inline",
edit : function(e){
selectedRowIndex = $("#grid").data("kendoGrid").select().index();
if (selectedRowIndex >= 0) {
var grid = $("#grid").data("kendoGrid");
var selectedItem = grid.dataItem(grid.select());
var slno = selectedItem.serial_no;
if(slno!=0){
grid.cancelRow();
}
}
}
});
但是当我使用它时,我在控制台中收到以下错误。
Uncaught TypeError: Cannot call method 'delegate' of null
有人可以建议一种方法来解决它。谢谢。