我在一个kendo ui网格上工作。网格默认情况下不可编辑。
在工具栏中有一个'编辑'按钮。当用户点击它时,网格应该可以在批处理模式下编辑,如this。kendo ui网格批量编辑,设置焦点
得到这个工作的唯一解决方案是删除并重新创建网格/数据源与新属性(可编辑:真实等)。
这个按预期工作。现在我想将焦点设置在第一行/单元格上,以便用户可以看到网格现在是可编辑的(在下面的示例中该行变为输入字段)。
对此有何建议?这个是fiddle。
$('.k-grid-edit').on('click', function (e) {
e.preventDefault();
// remove old grid
$('#grid').html('');
// recreate grid with edit: true and new datasource
$('#grid').kendoGrid({
dataSource: dataSourceInEdit,
editable: true,
columns: [{
field: 'TableId',
title: 'Id',
width: 50
}, {
field: 'Area',
title: 'Area'
}, {
field: 'Table',
title: 'Table',
width: 60
}, {
command: 'destroy',
title: ' ',
width: 100
}]
}).data("kendoGrid");
}); // end edit
您可以创建您的问题小提琴?您提供的链接中的网格具有不同的行为! –
@VivekParekh有一个 – chris