We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Reccurence editor - first render issue when remove "never" in endType and change frequencies

Hi guys again,

Problem is simple. 

You can check it here: https://stackblitz.com/edit/4a3eli-v4dtqh?file=index.js

function onPopupOpen(args) {
if (args.type === 'Editor') {
var recurElement = document.querySelector('.e-recurrenceeditor');

var repetFreq = recurElement.ej2_instances[0].frequencies;
if (repetFreq.length === 5) {
recurElement.ej2_instances[0].frequencies = ['none', 'daily', 'weekly'];
}

var endList = recurElement.ej2_instances[0].endType.dataSource;
if (endList.length === 3) {
recurElement.ej2_instances[0].endType.dataSource = [
{ text: 'Until', value: 'until' },
{ text: 'Count', value: 'count' },
];
}
}
}


1. When  endType, select drop down list get  rendered for the very first time, there is no change in drop down options. In this case "Never" is still there. But in browser - Developer Tools, it is only two of them "Never" has been removed. 
please check the image below:

Screenshot No 1.jpg

2

2. Some time after choosing repeat frequencies 'daily', 'weekly', endType drop down list  is missing  date picker
ScreenshotMissingDatePicker.jpg


And also, if you swap order places in the code for endType.dataSource and frequencies, and put frequencies after the endType.dataSource , you will have the same problem with the Repeat drop down options list.( all five, default options will be rendered ).

Thank you guys

Regards

Sinisha


1 Reply

RV Ravikumar Venkatesan Syncfusion Team January 23, 2023 04:01 PM UTC

Hi Sinisa,


Sample: https://stackblitz.com/edit/ej2-js-schedule-recurrence-frequency-and-end-type-sample?file=index.js


You can render the recurrence editor with repeat type frequencies with none, daily, and weekly values and render the end type values with until and count alone with help of the code snippet shown below.


UG(Customizing repeat type): https://ej2.syncfusion.com/javascript/documentation/schedule/recurrence-editor/#customizing-the-repeat-type-option-in-editor


[index.js]

function onPopupOpen(args) {

  if (args.type === 'Editor') {

    if (scheduleObj.eventWindow.recurrenceEditor) {

      if (scheduleObj.eventWindow.recurrenceEditor.frequencies.length > 3) {

        // Setting up recurrence editor repeat type frequencies.

        scheduleObj.eventWindow.recurrenceEditor.frequencies = ['none''daily''weekly'];

      }

      args.element.ej2_instances[0].open = () => {

        if (scheduleObj.eventWindow.recurrenceEditor.endType.dataSource.length > 2) {

          // Setting up the defaule end type as Until

          scheduleObj.eventWindow.recurrenceEditor.endType.setProperties({ value: 'until' });

          scheduleObj.eventWindow.recurrenceEditor.endType.open = (args=> {

            // Hiding the never end type

            args.popup.element.querySelector('[data-value="never"]').style.display = 'none';

          }

        }

      }

    }

  }

}


Regards,

Ravikumar Venkatesan


Loader.
Live Chat Icon For mobile
Up arrow icon