Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable events in Kendo UI scheduler?I just to make it read only

How to disable the event in kendo UI scheduler?I study the example from the official website examples,and see all of the cell in event have double click event to create and delete and other events,but now I just use it to show the result,so how to prevent all the create,delete,edit events?

like image 517
Lyly Avatar asked Apr 19 '14 16:04

Lyly


2 Answers

Use the editable configuration option:

$("#scheduler").kendoScheduler({
  date: new Date("2013/6/6"),
  dataSource: [
    {
      start: new Date("2013/6/6 08:00 AM"),
      end: new Date("2013/6/6 09:00 AM"),
      title: "Brunch"
    }
  ],
  editable: false
});

or if you're using the MVC wrappers:

.Editable(false)

If you want to disable specific events, see this answer.

like image 76
Lars Höppner Avatar answered Nov 15 '22 12:11

Lars Höppner


Using editable is fine if what you want applies to every event on the scheduler.

However, if you want specific events to be read only, then handle the edit event, and hide the appropriate buttons (isReadOnly would be a field you added to the schema):

var saveAndDelete = $(".k-scheduler-update, .k-scheduler-delete");

if (e.event.isReadOnly === true )
    saveAndDelete.hide();
else
    saveAndDelete.show();
like image 44
AUSTX_RJL Avatar answered Nov 15 '22 11:11

AUSTX_RJL