问题描述
我有一个ngGrid显示与基本键
/ 值
内容的几个记录。现在,我想提出的这些记录的一些的编辑。
I have an ngGrid that shows a few records with basically key
/ value
content. Now, I would like to make some of these records editable.
使用ngGrid的 enableCellEditing
的功能,我可以启用或完整的列禁用editin - 但如果我只希望使用它在该列中的某些行是什么?有什么办法来为每一行动态配置呢?
Using the enableCellEditing
features of ngGrid, I can enable or disable editin for a complete column - but what if I only want to enable it for some rows in that column? Is there any way to dynamically configure this for each row?
推荐答案
晚的答案,但 NG-网(也就是现在正在经历着脱胎换骨般的 UI网)现在有,您可以使用,使只有某些细胞可编辑的。
Late answer, but ng-grid (which is now being redone as ui-grid) now has a cellEditableCondition
that you can use to make only some cells editable.
您只需添加在你的 gridOptions
:
enableCellEditOnFocus: true,
cellEditableCondition: 'row.rowIndex !== 2' //can edit all rows except for the third
此功能后,才NG网availble的2.0.9
This feature availble only after ng-grid 2.0.9
这篇关于使只有某些细胞ngGrid编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!