Our powerful JS Calendar component


Post by jhemela »

Hi,

How can you listen to the action buttons for saving recurring events?
As well for the single 'YES' confirmation and also the 'ALL FUTURE EVENTS' and 'ONLY THIS EVENT'.

When i update a single standalone event and i press SAVE than an event is triggered and ik know wich event to save to the database.

   
@eventselectionchange="onEventSelectionChange" @eventclick="onEventClick" @beforeeventadd="onBeforeEventAdd" @beforeeventsave="onBeforeEventUpdate" @beforeEventEdit="onBeforeEventUpdate" @beforeeventdelete="onBeforeEventDelete" @aftereventdrop="onAfterEventDrop" @eventresizeend="onEventResizeEnd" @dragmoveend="onBeforeEventUpdate" @dragresizeend="onBeforeEventUpdate"
Attachments
2020-12-10 13_22_08-localhost_8080_#_calendar.png
2020-12-10 13_22_08-localhost_8080_#_calendar.png (40.82 KiB) Viewed 1385 times
2020-12-10 12_26_42-.png
2020-12-10 12_26_42-.png (56.44 KiB) Viewed 1385 times

Post by alex.l »

Hi jhemela,

We do not trigger special events there. What exactly you want to achieve with these events that cannot be achieved using changed data snippet on commit?

All the best,
Alex


Post by jhemela »

Hi,

I will try to document this tomorrow to make it clear what i mean.


Post by pmiklashevich »

Yes, please. Runnable testcase is required to be able to check the issue. Try to apply minimal changes to one of our demos. Thanks!

Pavlo Miklashevych
Sr. Frontend Developer


Post by jhemela »

First off: When holding CTRL and drag for creating recurring events it shows a dialog that i'm changing a repeating event. On creation this should not be the case
Also the new dialog where you can confirm that will not trigger an event beforeeventsave or beforeeventadd.
I opened up my network that in the examples so you can see the API calls are or are not triggered

5EPNweHHwm.gif
5EPNweHHwm.gif (679.08 KiB) Viewed 1368 times

For the change of an recurring event:
You will see there is a listener configured for the 'SAVE' button event: @beforeeventsave="onBeforeEventUpdate"
This will trigger a API call to our backend.
But when it is a recurring event the 'SAVE' button does not trigger te beforeeventsave event.
Instead it shows a new modal where you can either choose 'YES', 'ALL FUTURE EVENTS' or 'ONLY THIS EVENT'
Based on selecting the first event in the recurring or one of the following.
You will see that when we click these buttons i have no eventListeners for this action and so our backend data will never be updated.

Here you see a API call get triggered on creating a new event

Uv32ePf8Im.gif
Uv32ePf8Im.gif (940.37 KiB) Viewed 1368 times

Here you can see that no events are triggered when pressing the buttons in the modals because the save does not trigger an action anymore but it's triggering the modals:
In one of the examples you will see that even i choose 'ALL FUTURE EVENTS' not all the events are updated correctly.

fkn3CCFgHB.gif
fkn3CCFgHB.gif (3.45 MiB) Viewed 1368 times

Also when a recurring event takes place i saw that it is stored in a object variable recurrenceRule. But if you only change the middle one of the 3 events how should this be stored and keer the recurrenceRule data?


Post by pmiklashevich »

Hello!

Thank you for such detailed report! I've opened a bunch of tickets:
https://github.com/bryntum/support/issues/2125
https://github.com/bryntum/support/issues/2123
https://github.com/bryntum/support/issues/2124

Basically this all happen because in Calendar the drag feature creates new events and adds them to the store automatically. You can see the dragCreateEnd event. It says that the eventRecord is already in the store. You can perform validation (sync or async) in validateCreateFn. So since events are in the store already, when EventEditor is opened it treats them as existing events being edited. Therefore you see the confirmation dialog.

Regarding your last question recurrenceRule is a field holding the recurrence configuration. Whenever you apply changes to a specific event only, it becomes a standalone event and gets as an exception to the recurring event. See exceptionDates field. So further modifications of the main recurring event and applying the changes to all future occurrences will not update the exceptions.

Best regards,
Pavel

Pavlo Miklashevych
Sr. Frontend Developer


Post Reply