Editing recurrences - dialog flow and options

8 posts, 0 answers
  1. Simon
    Simon avatar
    22 posts
    Member since:
    Feb 2019

    Posted 15 Apr 2019 Link to this post

    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.

  2. Simon
    Simon avatar
    22 posts
    Member since:
    Feb 2019

    Posted 15 Apr 2019 Link to this post

    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? 
  3. Simon
    Simon avatar
    22 posts
    Member since:
    Feb 2019

    Posted 15 Apr 2019 Link to this post

    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?
  4. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1201 posts

    Posted 17 Apr 2019 Link to this post

    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.
  5. Simon
    Simon avatar
    22 posts
    Member since:
    Feb 2019

    Posted 22 Apr 2019 in reply to Veselin Tsvetanov Link to this post

    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?
  6. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1201 posts

    Posted 24 Apr 2019 Link to this post

    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.
  7. Simon
    Simon avatar
    22 posts
    Member since:
    Feb 2019

    Posted 02 May 2019 in reply to Veselin Tsvetanov Link to this post

    "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?

  8. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1201 posts

    Posted 06 May 2019 Link to this post

    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.

Back to Top