gpt4 book ai didi

angularjs - 在 ngGrid 中只能编辑某些单元格?

转载 作者:行者123 更新时间:2023-12-04 15:34:39 25 4
gpt4 key购买 nike

我有一个 ngGrid 显示一些记录,基本上是 key/value内容。现在,我想让其中一些记录可编辑。

使用 enableCellEditing ngGrid 的功能,我可以启用或禁用整个列的编辑 - 但是如果我只想为该列中的某些行启用它怎么办?有没有办法为每一行动态配置它?

最佳答案

迟到的答复,但 ng-grid (现在被重做为 ui-grid )现在有一个 cellEditableCondition 您可以使用它来使某些单元格可编辑。

您只需将它添加到您的 gridOptions :

enableCellEditOnFocus: true,
cellEditableCondition: 'row.rowIndex !== 2' //can edit all rows except for the third

Example plunker

此功能仅在 ng-grid 2.0.9 之后可用

关于angularjs - 在 ngGrid 中只能编辑某些单元格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20268522/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com