本文介绍了在剑道网格中禁用编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试根据条件使可编辑网格变为不可编辑.
I am trying make the an editable grid to uneditable depend on conditions.
我在jquery中尝试过如下
I have tried in jquery as below
var $grid = &("#gridName").data("kendogrid");
Var model = $grid.datasource.at(1);
if(model)
model.field["cell"].editable = false;
但是这里的模型"变得不确定.
but here the 'model' is getting undefined.
还尝试了$ grid.data(),然后循环遍历网格,但是单元格并不会变得不可编辑,而是仍然可编辑.
also tried $grid.data() and then looping through the grid, but the cells are not getting uneditable they are still editable.
任何人都可以让我知道如何进行这项工作.
Can anyone please let me know how can I make this work.
推荐答案
问题已解决.
var $grid = &("#gridName").data("kendoGrid");
var len= &("#gridName").data("kendoGrid tbody tr").length();
for(i=0;i<=len ; i++)
{
var model = $grid.datasource.at(i);
if(model)
model.fields["cell"].editable = false;
}
这篇关于在剑道网格中禁用编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!