How to show warning when updating events?

2 Answers 121 Views
Scheduler
Boris
Top achievements
Rank 1
Iron
Iron
Boris asked on 23 Jul 2021, 08:48 AM

Hello guys,

is it possible to display a warning on the scheduler when Update action is triggered? It happens often that users change the dates by mistake when using scheduler (they drag and drop or expand).

    Thanks.

    2 Answers, 1 is accepted

    Sort by
    0
    Accepted
    Aleksandar
    Telerik team
    answered on 28 Jul 2021, 07:21 AM

    Hello Boris,

    If Dragging and Dropping events and expanding them is not desired you can disable those features via the .Editable() configuration and setting the .Move(false) and .Resize(false):

    .Editable(e=>e.Move(false).Resize(false))

    If the functionality is required you can handle the MoveEnd and ResizeEnd events and prompt the user to confirm the change, for example you can implement the following handler for the MoveEnd event:

    function scheduler_moveEnd(e) {
              var scheduler = e.sender;
              var task = e.event;
              var start = e.start;
              var end = e.end;
              e.preventDefault()
              kendo.confirm("Save changes").then(function(){
                var editedEvent = scheduler.dataSource.get(task.id);
                editedEvent.set("start",start);
                editedEvent.set("end",end);
              })
            }

    Here is a dojo that demonstrates this in action.

    Regards,
    Aleksandar
    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/.

    0
    Boris
    Top achievements
    Rank 1
    Iron
    Iron
    answered on 29 Jul 2021, 04:16 PM
    That's it. Thanks.
    Tags
    Scheduler
    Asked by
    Boris
    Top achievements
    Rank 1
    Iron
    Iron
    Answers by
    Aleksandar
    Telerik team
    Boris
    Top achievements
    Rank 1
    Iron
    Iron
    Share this question
    or