问题
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