Read-only mode

Read-only mode

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

Read-only mode for the entire scheduler

To make the entire scheduler read-only you should set the DHXScheduler.Config.isReadonly option to true.

var sched = new DHXScheduler();
...
sched.Config.isReadonly = true;

Note, when the entire scheduler is non-editable, users can't open the lightbox.

Read-only mode for the lightbox

To leave for users the possibility to open the lightbox but forbid any editing inside it, you should set the DHXScheduler.Config.readonly_form option to true:

var sched = new DHXScheduler();
...
sched.Config.readonly_form = true;

Read-only mode for specific events

To make just specific events read-only, you should:

  • provide additional boolean property in the data model, named as 'readonly':

    public class Event
     {
            public int id { get; set; }
            public string text { get; set; }
            public DateTime start_date { get; set; }
            public DateTime end_date { get; set; }
            public bool @readonly {get;set;}
      }
  • add the Readonly extension to the app:

    DHXScheduler.Extensions.Add(SchedulerExtensions.Extension.Readonly);

Now, each time the user edits some event, the scheduler checks whether this event has the readonly property set to true, and if it has - forbids editing.


comments powered by Disqus