How to disable editing for some cells in row editing of JQGrid?(如何在 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});
所以你应该把 editable 设置为 false 或 true before 调用 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.
更新: Free 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 的行编辑中禁用某些单元格的编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 JQGrid 的行编辑中禁用某些单元格的编辑?
基础教程推荐
- npm start 错误与 create-react-app 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
