Read-only Mode
In this part we want to consider read-only mode in the context of 4 situations:
- Read-only mode for the entire scheduler;
- Read-only mode for the entire lightbox;
- Read-only mode for a lightbox's section;
- Read-only mode for specific events.
Read-only mode for the entire scheduler
To make the entire scheduler read-only, set the readonly option to true.
scheduler.config.readonly = true;
...
scheduler.init('scheduler_here', new Date(2027, 5, 11), "month");
Note, when the entire scheduler is non-editable, users can't open the lightbox.
Read-only mode for the entire lightbox
To leave for users the possibility to open the lightbox, but to forbid any editing inside it, set the readonly_form option to true:
scheduler.config.readonly_form = true;
...
scheduler.init('scheduler_here', new Date(2027, 5, 11), "month");
Related samples
Read-only mode for a lightbox's section
To make a specific lightbox's section read-only, use the disabled property of a DOM element of the related section object:
scheduler.config.lightbox.sections = [
{ name: "description", height: 200, map_to: "text", type: "textarea", focus: true },
{ name: "time", height: 72, type: "time", map_to: "auto" }
];
scheduler.attachEvent("onLightbox", () => {
const descriptionSection = scheduler.formSection("description");
descriptionSection.control.disabled = true;
});
Note, you refer to the section through its type, and all sections that have this type will be read-only at once.
Read-only mode for specific events
To make specific events read-only, add the readonly property to them and set it to true:
scheduler.getEvent(id).readonly = true;
The functionality is provided in the readonly extension, and to use it, enable the extension on the page.