Request user confirmation on event drag/drop + ask user if drop should affect series or occurrence

Hi,
I'm struggling with two user requirements, where I would appreciate your support:

  1. I need to request a user confirmation on any event move via drag/drop. I was able to slip a custom confirmation  dialog into the dragStop event handler, but when I set args.cancel = true after the user responded, it has no effect as the action did already complete. How can I stop a drop operation after such a delay?
  2. I noticed that drag/drop and resize operations by default affect the occurrence of a series and not the series itself. I need to give the user a choice, just as while editing an event via the editor. How can I achieve this?   
Thanks a lot for any help!

Regards
Julius

3 Replies 1 reply marked as answer

HB Hareesh Balasubramanian Syncfusion Team November 20, 2020 12:45 PM UTC

Hi Julius, 

Greetings from Syncfusion Support..! 

We have prepared a sample for both your shared queries which can be viewed from the following link. 


Q1: This can be achieved by allowing the confirmation dialog window in the dragStop event of the Scheduler. Kindly refer to the below code snippets and the same can be viewed in the above sample. 

  public onDragStop(args: any): void { 
    if (!isNullOrUndefined(args.data.RecurrenceRule)) { 
      if (confirm("Kindly confirm to edit entire series or not")) { 
        args.cancel = true; 
        this.scheduleObj.saveEvent(args.data, "EditSeries"); 
      } 
    } else { 
      args.cancel = !confirm("Kindly confirm the drop target"); 
    } 
  } 

Q2: This can be achieved using saveEvent public method of the Scheduler within dragStop event, kindly refer to the below code snippets and the same can be viewed in the above sample. 

  public onDragStop(args: any): void { 
    if (!isNullOrUndefined(args.data.RecurrenceRule)) { 
      if (confirm("Kindly confirm to edit entire series or not")) { 
        args.cancel = true; 
        this.scheduleObj.saveEvent(args.data, "EditSeries"); 
      } 
    } else { 
      args.cancel = !confirm("Kindly confirm the drop target"); 
    } 
  } 

Kindly try the above solution and get back to us if you need any further assistance. 

Regards, 
Hareesh 


Marked as answer

JP Julius Peter November 20, 2020 10:43 PM UTC

Thx Hareesh!
I understand now that I have to cancel the event and the  requested saveEvent with the parameters that reflect my case/the users choice. Works fine, except for the problem that when I e.g. move the third recurrence of a Series (drag/drop) and opt to move the series, all previous ocurrences are gone - and not just moved. You can check that effect in the StackBlitz you sent me.

I finally ended up in saving the the first occurrence of the series with the altered time/resource values. This works well. Dragging between days does not work that way, but I guess this will be quite complex as this might interfere with the RecurrenceRule. I currently plan to prevent such drag/drop moves.  


NR Nevitha Ravi Syncfusion Team November 23, 2020 04:57 AM UTC

Hi Julius, 

Thanks for your update. 

We are happy that your requirement has been achieved at your end. Please get back to us if you need any further assistance. 

Regards, 
Nevitha 


Loader.
Up arrow icon