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

how to hook into the destroy (delete) of the scheduler editor

2 Answers 427 Views
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Veteran
Jim asked on 03 Oct 2020, 09:48 PM

Precepts:   

> Kendo UI for Vue - Scheduler (using typescript)

> using :editable-template (with template imbedded into script in the markup)

I want to be able to hook into the destroy (editable-destroy option) such that when executed, I can call my own function to manage the event.
If possible, I would even like to manage (alter or even possibly replace) the default delete confirmation modal.

Can anyone help me figure out how this can be accomplished?

2 Answers, 1 is accepted

Sort by
0
Jim
Top achievements
Rank 1
Veteran
answered on 04 Oct 2020, 02:36 AM

..and if there isn't a clean way to do this, is it possible to use the edit template to override (and replace) the the onClick function for that button?

0
Petar
Telerik team
answered on 07 Oct 2020, 05:45 AM

Hi Jim,

Here is a StackBlitz example demonstrating how we can prevent the default delete functionality of the Scheduler. Here is the Scheduler's definition and the important configurations that are configured for it.

   <kendo-scheduler :data-source="localDataSource"
                     :date="date"
                     :height="600"
                     :editable-confirmation="false"
                     :timezone="'Etc/UTC'"
                      @edit="onEdit" 
                      @remove="onRemove">
.................................................

Setting the editable-confirmation configuration to false will remove the confirmation popup when the "Delete" button is clicked. The code in yellow defines a function that will be executed on the remove event of the Scheduler. Below is the definition of the "onRemove"  function in which we prevent the default behavior when the event is triggered. With this prevention, the "delete" functionality is not executed. After the prevention is made, you can implement your custom logic for handling the deletion. 

onRemove: function(e){
  e.preventDefault();
}

I hope the above will help you implement the targeted functionality in your application.

Regards,
Petar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Asked by
Jim
Top achievements
Rank 1
Veteran
Answers by
Jim
Top achievements
Rank 1
Veteran
Petar
Telerik team
Share this question
or