Is there any option available to set form (or part of the form) disabled while initializing the editor rather than calling disable function on editor (or part of the editor) ? Currently I have added disable: true option to my schema and then recursively disabling parts of the form (where disable: true) after the initialization, by following code snippet(corner cases are not handled).
/*
* Recursively disbale editor sections by checking the flag.
*/
var disableForm = function(editor, schema, path) {
// Disable current path if disable property is set.
if (schema.disable) {
editor.getEditor(path).disable();
} else {
// Otherwise recursively check if properties are disabled.
for (var key in schema.properties) {
if (schema.properties.hasOwnProperty(key)) {
disableForm(editor, schema.properties[key], path + '.' + key);
}
}
}
};
disableForm(editor, schema, 'root');