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

匿名 (未验证) 提交于 2019-12-03 08:54:24

问题:

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?

回答1:

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.



回答2:

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(); 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!