Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handle destroy event in kendo scheduler

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.

enter image description here

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.

like image 277
Swaraj Avatar asked Mar 16 '15 10:03

Swaraj


1 Answers

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

like image 129
Vladimir Iliev Avatar answered Oct 18 '22 09:10

Vladimir Iliev