将版本限制为行编辑器网格中的一个单元格
在我的 editorGrid 中,我有一列带有 dateField 编辑器,当网格被渲染时,我将该字段设置为不可编辑:
myColModel.setEditable(colIdex,false)
在同一行中其他单元格中的值更改后,它将是可编辑的,
myColModel.setEditable(colIdex,true)
问题是:该列中的所有单元格都是editables
我怎样才能只使所选行中的单元格可编辑
,非常感谢
in my editorGrid i have one column with dateField editor , when the grid is rendred i set that field to non editable :
myColModel.setEditable(colIdex,false)
it will be editable after the value changed in other cell in the same row
myColModel.setEditable(colIdex,true)
the probleme is : all the cells in the column are editables
how can i do to make only the cell in the selected row editable
and many thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用 EditorGrid 上的“beforeedit”侦听器 - 您可以检查他们尝试编辑的字段。如果未设置其他字段,则返回 false 以不允许他们编辑该字段。
Use the 'beforeedit' listener on the EditorGrid - you can inspect the field they are trying to edit. If the other field isn't set, return false to not allow them to edit that field.
基本上,您可以创建条件逻辑并隐藏基于行模型的编辑按钮。
Basically you can create conditional logic and hide the edit buttons based on the row model.
您可以通过重写 isCellEditable 函数来以其他方式完成此操作。
检查下面的链接。
http://www.sencha.com/learn/Ext_FAQ_Grid#Disable_editing_of_pspecial_rows.2C_columns.2C_etc
You can do it other way by just overriding the isCellEditable function.
Check the below link.
http://www.sencha.com/learn/Ext_FAQ_Grid#Disable_editing_of_particular_rows.2C_columns.2C_etc