Handle destroy event in kendo scheduler

强颜欢笑 提交于 2019-12-12 10:45:52

问题


I am using a kendo scheduler. There are events added in scheduler grid.

On mouse hover of each event a small (x) comes on top right corner. i.e destroy event for that event, which when clicked shows an warning message "Are you sure you want to delete this event?" If clicked Yes it goes ahead and deletes that event.

So here is my requirement.

As you can see above there are 3 scheduled events in the shown week. I want that, the one circled in blue shouldn't have delete option but the one circled in red should have. In other words, I want to restrict some events in the kendo scheduler from deleting.

Scenario: Lets say any event having a description can't be deleted.

Link: http://demos.telerik.com/kendo-ui/scheduler/move-resize

Update I can do a server side call to check if description has value or not and then return any result to show any message that I want, but I want restriction at client side only so that an user won't be able to click that (x) link and it is not displayed at all.


回答1:


There are several ways to handle this scenario. For example you can attach custom "click" event handler to the "X" button in the event element in which to either allow or restrict propagation of the event. If you need the underlying event object you can get it by passing the "uid" attribute of the event element to the "occurrenceByUid" method of the scheduler.

Example



来源:https://stackoverflow.com/questions/29074344/handle-destroy-event-in-kendo-scheduler

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