Make All Columns Read-Only
Disabled_XXXXX_SubGridOnSelect: function (ExecutionContext) {
let that = this;
let objFormContext = ExecutionContext.getFormContext();
let entObject = objFormContext.data.entity;
entObject.attributes.forEach(function (attribute) {
let allColumnControl = attribute.controls.get(0);
allColumnControl.setDisabled(true);
});
}
Make Specific Columns Read-Only
Disabled_XXXXX_SubGridOnSelect: function (ExecutionContext) {
let objFormContext = ExecutionContext.getFormContext();
let entObject = objFormContext.data.entity;
entObject.attributes.forEach(function (attribute) {
let columnName = attribute.getName();
if (
columnName == "your field name 1" ||
columnName == "your field name 2" ||
columnName == "your field name 3" ||
columnName == "your field name 4" ||
columnName == "your field name 5" ||
columnName == "your field name 6") {
attribute.controls.get(0).setDisabled(true);
}
});
}
Binding
Open the form, select the editable subgrid, and then bind the method (don’t forget to check “Pass execution context as first parameter”).
Comments