nggrid how can I disable/enable individual column

丶灬走出姿态 提交于 2019-12-25 02:18:17

问题


I have a nggrid with a name and an age column with some data.

so it looks like this:

Name | Age
50 | 50 : age field has green background because name and age col have same value

How can I make the age column editable/noneditable depending on the namecolumn value in this row?

see also: http://plnkr.co/edit/OxJqS5LYOvG2vx0Ujhu7?p=preview


回答1:


You can use cellEditableCondition on a per-column basis within the columnDefs like so:

cellEditableCondition: 'row.getProperty(\'name\') == row.getProperty(\'age\')'

See Plunker here. If you want to control editing on a per-row basis, move cellEditableCondition out of the columnDefs and into the gridOptions.



来源:https://stackoverflow.com/questions/22054427/nggrid-how-can-i-disable-enable-individual-column

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!