我有一个像这样的剑道网格
$("#HoleGrid").kendoGrid({ ... });
Run Code Online (Sandbox Code Playgroud)
如何找出网格中有多少行?
未捕获的类型错误:无法读取未定义的属性“模板”
我正在使用剑道网格。
我想在编辑时禁用列。(不是在我添加新记录时)。编辑时写了代码
function onEdit(e) {
var indexCell = 1;
var grid = $('#consumablesGrid').data('kendoGrid');
if (e.model.id) { // when Editing the id is defined
if (indexCell != 'undefined' && grid.columns[indexCell].title == "Consumable") {
grid.closeCell();
}
}
}
Run Code Online (Sandbox Code Playgroud)
但它"Uncaught TypeError: Cannot read property 'template' of undefined "在执行时显示grid.closeCell()。
为了更好地理解,我包括我的完整网格条件。
function ConsumableManager() {
$("#consumablesGrid").kendoGrid({
dataSource: {
transport: {
read: {
url: "GetConsumablesGrid",
type: "POST",
contentType: "application/json",
dataType: "json"
},
update: {
url: "UpdateConsumables",
contentType: "application/json",
type: "POST",
dataType: "json", …Run Code Online (Sandbox Code Playgroud)