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 的行编辑中禁用某些单元格的编辑?


基础教程推荐
- 每次设置弹出窗口的焦点 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01