Hi community,
I'm trying to disable the columns of an editable detail to make them read only and I have read many articles about it, but I'm still having a problem that I can't fix.
I wrote this code in the GridDetail to disable the fields but I noticed that for some of the columns of the detail is not working.
getCellControlsConfig: function(entitySchemaColumn) {
if (!entitySchemaColumn) {
return;
}
var columnName = entitySchemaColumn.name;
var enabled = (entitySchemaColumn.usageType !== this.Terrasoft.EntitySchemaColumnUsageType.None) &&
!this.Ext.Array.contains(this.systemColumns, columnName);
var config = {
itemType: this.Terrasoft.ViewItemType.MODEL_ITEM,
name: columnName,
labelConfig: {visible: false},
caption: entitySchemaColumn.caption,
enabled: enabled
};
if (!this.values.IsEnabled) {
config.enabled = false;
//config.labelConfig.enabled = false;
//this.set("Is"+columnName+"enabled", false);
}
if (entitySchemaColumn.dataValueType === this.Terrasoft.DataValueType.LOOKUP) {
config.showValueAsLink = false;
}
if (entitySchemaColumn.dataValueType !== this.Terrasoft.DataValueType.DATE_TIME &&
entitySchemaColumn.dataValueType !== this.Terrasoft.DataValueType.BOOLEAN) {
config.focused = {"bindTo": "Is" + columnName + "Focused"};
}
console.log(config);
return config;
},
Debugging I have discovered that the detail adds to the labelConfig the property "enabled" which is binded to an attribute ("isProductenabled").
I tried to force the property writing it in the method and I also tried to set the attribute manually, but it's not working... do you have any idea?
Let me know.
Thanks in advance.
Best regards,
Luca