Your code works for the Editable Grid, but I also want to disable fields on the 'Nested' grid... When I use the same code for the OnRecordSelect event of the nested grid, I get an error:
Cannot read properties of null (reading 'data')
Here is the code I am using for both the Editable Grid and the nested Editable Grid:
function setGridReadOnly(context) {
var entityObject = context.getFormContext().data.entity;
entityObject.attributes.forEach(function (attribute, i) {
var ctrl = attribute.controls.get(0);
ctrl.setDisabled(true);
})
}