Premium support for our pure JavaScript UI components


Post by tobias.aires »

Where should i put this code ?

occurrence.recurrenceRule = null;

Post by tobias.aires »

Animal wrote: Wed Mar 22, 2023 5:38 pm
tobias.aires wrote: Wed Mar 22, 2023 5:29 pm

How can i allow my user to create multiple events the repeat periodically?

It's part of the editor:

Screenshot 2023-03-22 at 16.38.15.png

But i only get this tab if i set enableRecurringEvents to true


Post by tobias.aires »

Hello,

occurrence.recurrenceRule = null;

if i put this on my eventRenderer only 1 event is created. The correct place is on eventRenderer function?


Post by Animal »

You need to get a reference to the occurrence that you are going to turn into a real, concrete event. Don't do that on the base, otherwise that will destroy the recurringness of the base.


Post by tobias.aires »

    
if (eventRecord.isOccurrence) { const chapterNumber = eventRecord.occurrenceIndex + 1 event_name = 'Cap. ' + chapterNumber eventRecord.recurrenceRule = null; }

I tried something like this, but now the component is not respecting de rule from the recurrence tab

Attachments
Screenshot from 2023-03-23 12-20-00.png
Screenshot from 2023-03-23 12-20-00.png (59.84 KiB) Viewed 301 times

Post by Animal »

I do not understand what your app requirement is, or how you are trying to get there.

recurring events are based on one single base event which has a rule. The "occurrences" of it in the future are not stored in the database.

They are just displayed in the UI according to the rule.


Post by tobias.aires »

I think that my app requirement is to create serie of real events by some rule, for example after 2 weeks on every starting every monday, and saving those events on my database. Is this possible somehow?


Post by Animal »

How many real events? Because if it's recurring on a rule, then there will be an infinite number of them.


Post by tobias.aires »

This value will be set by the user.

Using the recurrenceTab, i tought in using the last input, telling the component to stop after X times.

If somehow i could use this tab to get real events.

Attachments
Screenshot from 2023-03-24 12-32-25.png
Screenshot from 2023-03-24 12-32-25.png (51.42 KiB) Viewed 294 times

Post by alex.l »

We do not support that. It is not recurring events in that case, but simple events that added with some period. So, you need to add them one by one into eventStore yourself, using data you need (name, dates, etc). It's not supported with recurringEvents feature and cannot be done using that feature, because main goal of that feature is to reduce amount of events in database using rules instead of instances.

Regarding to this code you posted

    
if (eventRecord.isOccurrence) { const chapterNumber = eventRecord.occurrenceIndex + 1 event_name = 'Cap. ' + chapterNumber eventRecord.recurrenceRule = null; }

We do not support change any data of record inside renderer. See docs here https://bryntum.com/products/schedulerpro/docs/api/Scheduler/view/mixin/SchedulerEventRendering#config-eventRenderer after IMPORTANT text.

All the best,
Alex


Post Reply