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

Ability to alter the delete confirmation prompt

1 Answer 46 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 15 Aug 2017, 12:35 PM

When deleting an item a prompt message will appear:

if a single occurrence: "Are you sure you want to delete this event?" <Delete> <Cancel>

if recurrence: "Do you want to delete only this event occurrence or the whole series?" <Delete current occurrence> <Delete the series>

I would like to add in the title of the event to the prompt text so the user can verify her/she is deleting the proper event.

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 17 Aug 2017, 08:09 AM
Hello Erik,

The required could be achieved by injecting the task title text into the prompt message using jQuery. To do that, in the dataBound event of the Scheduler you could attach a click event handler for the delete cross of the task. This click handler injects the additional text directly in the prompt element:
dataBound: function(e) {
    $('.k-event-delete').on('click', function(e) {
    var targetEvent = e.target.closest('.k-event');
    setTimeout(function() {
      var eventText = $(targetEvent).find('.k-event-template:not(.k-event-time)').text();
      var messageElement = $('.k-popup-message');
      var currentText = messageElement.text();
      var newText = currentText.replace('this', '"' + eventText + '"');
        messageElement.text(newText);
    }, 0);
  });
},

Here you will find a simple Dojo, implementing the above.

Regards,
Veselin Tsvetanov
Progress Telerik
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.
Tags
Scheduler
Asked by
Erik
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or