如何在JQGrid的行编辑中禁用某些单元格的编辑? [英] How to disable editing for some cells in row editing of JQGrid?
问题描述
当我点击网格的任何一行时,所有可编辑的列都可以编辑。
When I click on any row of my Grid, All editable columns become editable.
我希望某些列可以分别在每一行上编辑。
I want some of the columns to be editable on each row separately.
Column 1, Column 2, Column 3
ROW Number 1 - editable, non-editable, non-editable
ROW Number 2 - non-editable, editable, non-editable
ROW Number 3 - editable, non-editable, non-editable
提前致谢
推荐答案
如果您使用内嵌编辑模式并想要动态决定哪些单元格该行的编辑将是可编辑的,例如根据单元格的包含,您可以按照我描述的方式执行此操作此处。您也可以使用其他方法执行此操作:
If you use inline editing mode and want to decide dynamically which cells of the row will be editable for example based on the contain of the cells you can do this in the way which I described here. You can do this with another method also:
$(this).jqGrid('setColProp', 'YouColumnName', {editable:false});
所以你应该将可编辑
设置为<在调用 false 或 true
.com / jqgridwiki / doku.php?id = wiki:inline_editing#editrowrel =nofollow noreferrer> editRow 方法。在你可以实现任何你想要的逻辑的方式。
So you should just set editable
to false
or true
before calling of editRow method. In the way you can implement any logic which you want.
更新: 免费jqGrid 允许将可编辑
定义为回调函数。请参阅维基文章。它允许使列在某些行中可编辑,并对其他行保持不可编辑。
UPDATE: Free jqGrid allows to define editable
as callback function. See the wiki article. It allows to make the column editable in some rows and holding non-editable for other rows.
这篇关于如何在JQGrid的行编辑中禁用某些单元格的编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!