Read-only Mode

In this part we want to consider read-only mode in the context of 4 situations:

  1. Read-only mode for the entire scheduler;
  2. Read-only mode for the entire lightbox;
  3. Read-only mode for a lightbox's section;
  4. 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(2019, 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(2019, 5,11),"month");

The readonly option is provided in the dhtmlxscheduler_readonly.js extension and to use it, include the extension file on the page.

Related sample:  Read-only lightbox

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", function(){
   var section = scheduler.formSection("description");
   section.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 property 'read-only' to them and set it to true:

scheduler.getEvent(id).readonly = true;

The functionality is provided in the dhtmlxscheduler_readonly.js extension and to use it, include the extension file on the page.

Related sample:  Read-only events

Back to top