Unplanned
Last Updated: 26 Aug 2019 13:00 by ADMIN
TMM
Created on: 23 Aug 2019 02:19
Category:
Type: Feature Request
0
Scheduler event for before removing and after removing

Currently, there is a @remove event that triggers after Delete is pressed in the default delete modal. 

This seems non-parallel to how the @edit event works where it triggers as soon as a scheduler item is double clicked (edited) or when an open timeslot is double clicked (create new).

With @edit, I can customize what happens after an attempt to edit/create was made because it is triggered before an action is finalized.

With @remove, I cannot do the same because @remove doesn't trigger after an attempt to delete is made.

 

Is it possible to have an event that fires when the k-event-delete (the 'x' button) is clicked?

3 comments
ADMIN
Ivan Danchev
Posted on: 26 Aug 2019 12:59

Hi Kathy,

 

Thank you for elaborating on the use case. We agree that in such cases it would be useful to be able to handle the event deletion earlier, when the confirmation hasn't yet popped up. Thus, I made this thread public in our Feedback Portal.

For a workaround, see Ondrej's post in this stackoverflow thread, which shows a possible approach that checks the value of field in the event data and based on that value hides certain events' "x" button (and "Delete" button in the editor).

 

Regards,
Ivan Danchev
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
TMM
Posted on: 26 Aug 2019 03:00

Hi Ivan, thanks for responding.

The way it's currently setup, each event will show the delete modal when 'x' is pressed. There might be some cases where one doesn't want a specific event to be deletable, and although you could achieve this by running e.preventDefault() everytime for said events that shouldn't be deletable, it's bad user experience to have to be asked when the user's decision does not matter.

However, I've found a better workaround for this, and that is just setting .k-event-actions CSS to display:none; instead, so the delete button is invisible. (and setting display:block on the items that I want to be deletable).

Right now though, it's a CSS hack. Maybe as an edit to my original request, there could be a way to add a boolean attribute called 'deletable' on each dataSource item to identify if it can be deleted (and if 'x' shows up or not)?

If needed, I'm happy to resolve this and create a new feature request ticket.

ADMIN
Ivan Danchev
Posted on: 23 Aug 2019 17:22

Hello,

Could you please elaborate on the value of having an additional event when clicking the 'x' button? As it is, the event data can already be accessed in the remove event (e.event) and if there is a reason for the event not to be deleted, you have the option of preventing the event by calling e.preventDefault(). Thus, the event removal action is not final since you can prevent it conditionally, and optionally notify the user why the specific event cannot be removed.

Regards, Ivan Danchev
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items