This is a migrated thread and some comments may be shown as answers.

Preventing events from being deleted by someone who is not owner of event?

2 Answers 130 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Tyler
Top achievements
Rank 1
Tyler asked on 03 Mar 2017, 05:34 PM

I want to either throw a popup saying "You are not the event owner!" or get rid of the delete 'x' icon altogether if a user is not the owner of the event and tries to delete it. Right now, I have an if statement wrapping the content of my delete operation in my scheduler dataSource, so if they are not the user, it does not go in and delete the event in the Database and pops open the window saying they can't do that... However, kendo goes ahead and removes the event from the calendar anyway.......... If you refresh, the event comes back because it wasn't deleted from database.

 

How do I prevent kendo from removing an event from the calendar if the delete key was pressed while the user was not the event owner? Or how can I hide the delete option from any user that is not the event owner?

2 Answers, 1 is accepted

Sort by
1
Joana
Telerik team
answered on 06 Mar 2017, 01:50 PM

Hello Tyler,

You could use the remove event of the Scheduler to prevent the deletion and the dataBound event to hide the close button. Here is a dummy dojo showing the usage of the events:

http://dojo.telerik.com/@jivanova/IyedU

I hope this will help you achieve the desired behavior.

Regards,
Joana
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Tyler
Top achievements
Rank 1
answered on 06 Mar 2017, 02:38 PM
Thanks, I used the remove event to simply set e.preventDefault to prevent the event from being deleted then opened the popup I wanted to notify they don't have permission to do the desired action. I had completely overlooked the remove event.
Tags
Scheduler
Asked by
Tyler
Top achievements
Rank 1
Answers by
Joana
Telerik team
Tyler
Top achievements
Rank 1
Share this question
or