Our powerful JS Calendar component


Post by SemFA »

Hello,

I'm trying to figure out how I can overrule the RecurrenceConfirmationPopup and always use "Only this event". I haven't been able to find any configuration I can do to do this, can you guys help me out?

The use case is that we do the recurrence editing on another screen, and the calendar is only used to change specific events.


Post by Animal »

This seems like a reasonable thing that should be supported out of the box with simple configuration.

That is not now the case, but it can be worked around.

Configure the eventEdit feature on the Calendar like this:

    features : {
        eventEdit : {
            onRecurrableEventBeforeSave({ eventRecord, context }) {
                const me = this;

                // Other views features may trigger beforeEventSave, so only react when *we* are editing.
                if (me.isEditing && !eventRecord.isCreating && eventRecord.supportsRecurring &&
                        (eventRecord.isRecurring || eventRecord.isOccurrence)) {

                    Object.assign(me.recurrenceConfirmation, {
                        actionType : 'update',
                        eventRecord,
                        changerFn() {
                            context.finalize(true);
                        }
                    });
                    context.async = true;
                    me.recurrenceConfirmation.processSingleRecord();
                }
            }
        }
    }

That should get you there.


Post by Animal »

Here's the ticket: https://github.com/bryntum/support/issues/7606

I hope we can fit it in sometime.


Post by SemFA »

Hi Animal,

Thank you for the notice. We will gladly await the new configuration feature.

In the meantime, I have implemented your workaround. We'd also like this to happen when you drag/resize an event. I've been able to access the recurrenceConfirmation through this.eventEdit.recurrenceConfirmation, but I seem to be getting eventtip errors.

Uncaught TypeError: Cannot read properties of undefined (reading 'readOnly')
    at EventTip.updateContent (EventTip.js:243:301)
    at EventTip.refreshContent [as refreshContentNow] (EventTip.js:225:1)
    at EventTip.eval (Delayable.js:642:1)
    at EventTip.invoker (Delayable.js:61:1)
    at eval (Delayable.js:304:1)

this happens when I call this.eventEdit.recurrenceConfirmation.processSingleRecord() from beforeEventDropFinalize event.

here is the code that I use:

beforeEventDropFinalize({ context }) {
	const { eventRecord } = context;
	
	if (eventRecord.supportsRecurring && (eventRecord.isRecurring || eventRecord.isOccurrence)) {
		Object.assign(this.eventEdit.recurrenceConfirmation, {
			actionType: "update",
			eventRecord,
			changerFn() {
				context.finalize(true);
			},
		});

		context.async = true;

		this.eventEdit.recurrenceConfirmation.processSingleRecord();
	}
}

Post by alex.l »

Hi,

It won't be working like that, you're setting EventEdit feature dialog in EventDrag feature event. I am afraid you need to wait for our update.
I added a note to the ticket.

All the best,
Alex


Post by SemFA »

alex.l wrote: Thu Oct 05, 2023 1:09 pm

Hi,

It won't be working like that, you're setting EventEdit feature dialog in EventDrag feature event. I am afraid you need to wait for our update.
I added a note to the ticket.

Alright, thank you.


Post Reply