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

Editing recurrences - dialog flow and options

7 Answers 391 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 15 Apr 2019, 08:40 AM

Hi,

I am looking to make changes to the flow of editing recurrences. Is it possible to change the order of when to show the dialog for selecting whether to edit the current occurrence or the series, so it is shown after the edit dialog?

I am looking to do the following: Whenever an event is edited it is always the current instance that is shown. After changes have been made in the edit dialog, the user is shown the options of whether to apply the changes to the series or to the instance. Is this possible?

Also is it possible to add an option to the "edit recurrence" dialog? I want to add the option of changing only the current instance edited and future instances.

7 Answers, 1 is accepted

Sort by
0
Simon
Top achievements
Rank 1
answered on 15 Apr 2019, 08:43 AM
Also the above functionality means that I need to show the recurrence rule in the edit dialog also when editing an occurrence. How would I best implement this without actually adding the recurrence rule to the instance when saving? 
0
Simon
Top achievements
Rank 1
answered on 15 Apr 2019, 08:45 AM
Also the functionality requires that the recurrence rule for the series is shown even when editing an occurrence. How would this best be implemented so the rrule is not stored on the instance when saving the changes?
0
Veselin Tsvetanov
Telerik team
answered on 17 Apr 2019, 06:49 AM
Hello Simon,

I am afraid that the Scheduler widget could not be configured to show the series/instance pop-up after a recurring event has been edited. The Edit occurrence dialog could not be customized. If you need to make any changes to the editing logic, you will have to place such option on a Scheduler custom editor template. Then, upon save, you could perform your custom logic that would apply the changes to all future occurrences if that option has been selected.

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Simon
Top achievements
Rank 1
answered on 22 Apr 2019, 10:35 AM
I would like to always show the recurrence editor when editing a series or an occurrence. So my question is, is it possible to show the recurrence editor as read only/disabled in the edit template when editing a single occurrence?
0
Veselin Tsvetanov
Telerik team
answered on 24 Apr 2019, 06:54 AM
Hello Simon,

When editing a single occurrence, the recurrence rule of its master event is not passed to the Event model. Nevertheless, as the edited occurrence holds a reference to its master ID, you could read the recurrence rule and pass it to the pop-up editor. To do that, you will have to handle the edit event of the Scheduler:
edit: function(e) {
  var recurrenceId = e.event.recurrenceId;
  var scheduler;
  var dataSource;
  var masterEvent;
  var rule;
  var container;
  var ruleElement;
  var overlayElement;
   
  if (recurrenceId) {
    scheduler = e.sender;
    dataSource = scheduler.dataSource;
    masterEvent = dataSource.get(recurrenceId);
    rule = masterEvent.recurrenceRule;
     
    container = e.container;
    ruleElement = $('<div id="recRule">');
    ruleElement.insertBefore(container.find('.k-edit-buttons'));
    ruleElement.kendoRecurrenceEditor({
        value: rule
    });
     
    overlayElement = $('<div style="position:absolute;width:400px;height:251.5px;background:white;z-index:100;opacity:0.5">');
    overlayElement.prependTo(ruleElement);
     
  }
},

Here you will find a Dojo sample implementing the above suggestion.

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Simon
Top achievements
Rank 1
answered on 02 May 2019, 03:09 PM

"Then, upon save, you could perform your custom logic that would apply the changes to all future occurrences if that option has been selected."

I am using a server side data source with the transport-submit function for handling the create, update and delete requests, see code snippet:

submit: function (e) {
   const data = e.data;
   //data.created
   //data.updated
   //data.destroyed
}

 

Where in the process/flow is it best to apply the custom logic that defines the "dirty" data so that the state of data.created, data.updated and data.destroyed looks how I want it to?

Is it in the save event? Or is there another place where it is better?

0
Veselin Tsvetanov
Telerik team
answered on 06 May 2019, 07:08 AM
Hi Simon,

Yes, the save event handler of the Scheduler is a proper place where you could perform your custom modifications to the DataSource of the widget.

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.

Tags
Scheduler
Asked by
Simon
Top achievements
Rank 1
Answers by
Simon
Top achievements
Rank 1
Veselin Tsvetanov
Telerik team
Share this question
or