Also, we recommend using readOnly instead of disabled for accessibility reasons
Re: [ANGULAR] editor fields will not stay disabled
Posted: Thu Oct 06, 2022 10:47 pm
by bherford
Marcio, thanks for the quick response
I implemented your code snippet - and initially displayed properly, then when I changed another field they became editable again:
Screen Shot 2022-10-06 at 4.45.26 PM.png (123.35 KiB) Viewed 564 times
Screen Shot 2022-10-06 at 4.45.43 PM.png (122.99 KiB) Viewed 564 times
Re: [ANGULAR] editor fields will not stay disabled
Posted: Fri Oct 07, 2022 1:09 am
by marcio
Hey bherford,
Could you confirm which version are you using? As you can see in the video, in our latest version demos with that configuration that I shared we don't have that behavior, perhaps you have another configuration that could be causing that behavior, are you able to create a sample configuration for us to check?
Re: [ANGULAR] editor fields will not stay disabled
Re: [ANGULAR] editor fields will not stay disabled
Posted: Tue Oct 11, 2022 8:14 pm
by marcio
Hello bherford,
I got an error when trying to compile that project, could you please update the source code or provide a valid configuration for the project that you shared?
Re: [ANGULAR] editor fields will not stay disabled
Posted: Wed Oct 12, 2022 3:40 pm
by bherford
Hi Marcio,
I was able to find a workaround by adding
beforeTaskEditShow({editor}) {
// Define list of fields to disable.
const disabledAdvancedFields = ['rollupField', 'manuallyScheduledField', 'effortDrivenField', 'schedulingModeField']
disabledAdvancedFields.forEach(field => {
// e.g: editor.widgetMap.rollupField.readOnly
editor.widgetMap[field].readOnly = true
// Without this class the field looks editable
editor.widgetMap[field].cls = 'b-disabled'
})
},
Re: [ANGULAR] editor fields will not stay disabled