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 fill just selected time from Custom Editor Window

Hi guys,

I have Custom Editor Window , so I am using method:

editorTemplate={editorTemplate.bind(this)}

By my logic from function editorTemplate I'm calling my component SchedulerPopUpEditor. Init is a few TimePickerComponent, ComboBoxComponent, DropDownListComponent ....... and RecurrenceEditorComponent.

<RecurrenceEditorComponent
            ref={recurrObject}
            id='RecurrenceEditor'
            change={handleRepeaterChange.bind(this)}
            dateFormat='dd/MM/yy'
            frequencies = {['none', 'daily', 'weekly']}
            minDate={new Date()}
            selectedType='0'
          ></RecurrenceEditorComponent>

Everything works just fine, but when I create recurring event - only one,  selected time from scheduler get filled with data, not selected time for tomorrow or any other date.
On other hand,  if I don't use the Custom Editor Window everything works fine. 
So I checked on your examples, and there is same problem, (I think this is a problem).

What is happened:
EVENT: Test Time Fields is created to be every day for the next 10 days in same time. But there is just one for selected time field.

Please check this link for this example and  : https://ej2.syncfusion.com/react/documentation/schedule/editor-template/#how-to-add-recurrence-options-within-editor-template
example-no1.jpg


What is expectation:
https://stackblitz.com/edit/4a3eli-fhvbrf?file=index.js
Screenshot 2023-01-13 at 6.50.16 pm.png  

Can you give me some advice how to use the Custom Editor Window with RecurrenceEditorComponent and have that effect which will fill selected times in scheduler ?

Thank in advance, I hope that you can understand my explanation of the problem.

Cheers,

Sinisha


5 Replies

MG Mugilraj Govindarajan Syncfusion Team January 16, 2023 08:41 AM UTC

Hi Sinisa,


The popupClose event can help you solve this problem. You can set the editor recurrence rule value to the appointment field recurrence rule by using popupClose event args, as shown in the snippet below.


Sample: https://stackblitz.com/edit/react-g2twjs?file=index.js


[index.js]

function onPopupClose(args) {
    if (args.type === 'Editor' && args.data) {
      args.data.RecurrenceRule =

args.element.querySelector('#RecurrenceEditor').ej2_instances[0].value;

    }
  }


Regards,

Mugilraj G



SI Sinisa January 17, 2023 12:26 AM UTC

Hi Mugilraj,

Thank you for your help. 
How I see this will work, but when I implement this code, I got error :

Uncaught TypeError: endDate.getTime is not a function  in  event-base.js?450c:872 (file from @syncfusion npm package ) 

I will try to track this error, not sure why I got this but I will check.

Thank you again




RV Ravikumar Venkatesan Syncfusion Team January 17, 2023 07:08 PM UTC

Sinisa,


Sample: https://stackblitz.com/edit/ej2-react-schedule-editor-template-with-recurrence-opt?file=index.js


We have checked our shared sample at our end. But, we are unable to reproduce the issue on our end. We suspect that the appointment EndTime value is not a valid Date. So, we suggest you make sure the appointment EndTime field value is a valid Date. If you are still facing the same problem share the below details to proceed further.


  • Issue reproducing code snippets or
  • Reproduce the issue in our shared sample or
  • Issue reproducing sample.
  • Issue reproducing steps.


SI Sinisa January 18, 2023 02:54 AM UTC

Hi Ravikumar,

Thank you for your help, but I tried that - value was already in Date type, created with the new Date () function.

I trace data and for some reason, parent component with Scheduler component, receive through editorTemplate  dates from child component with  as string instead of date object, ad. Reason is simple, I was have idea to use just TimePickerComponent not DateTimePickerComponent (I didn't need to select date in my scenario ). 

So all good, as always my mistake.


But at the end I decide to work on the build Editor window, and to do customisation with a build function and all it's working great ... for now.

Thank you for your help

Regards

Sinisa



RV Ravikumar Venkatesan Syncfusion Team January 18, 2023 07:31 PM UTC

Sinisa,


Please get back to us if you need any other assistance.


Loader.
Live Chat Icon For mobile
Up arrow icon