Skip to content

chooseScope

Decides how far a move, a resize or a deletion of one occurrence of a repeating event reaches.

Type(request: ScopeRequest) => EditScope | null | Promise<EditScope | null>
Defaulta "this / following / all" menu where the event was dropped
Live update (update())Yes
Declared inpackages/dom/src/settings.ts

A person drags an occurrence of a weekly meeting: is it this one, this one and the following, or all of them? By default the calendar asks, with a small “this / following / all” menu where the event was dropped.

Give a function to decide yourself — your own dialog, or a rule: it receives { instance, kind, proposal? } (kind is 'move', 'resize' or 'delete') (proposal for a move or a resize) and returns, or resolves to, 'this', 'following' or 'all' — or null to cancel, the event going back to its place. A promise lets the calendar wait for your dialog. It is asked for a drag, a resize and the Delete key; the context menu’s “Delete” on an occurrence has its own this / following / all sub-menu (to forbid it, leave event.delete out with contextMenu). A drag that turns an occurrence timed to all-day, or back, changes that one only, without asking.

import { createCalendar } from '@dzcalendar/dom';
import '@dzcalendar/core/recurrence';
createCalendar(element, {
timeZone: 'Europe/Paris',
editable: true,
events: [{ id: 'staff', title: 'Staff meeting', start: '2026-10-19T09:00[Europe/Paris]', rrule: 'FREQ=WEEKLY' }],
// The Delete key: always this one; a drag or a resize asks the application's own dialog.
chooseScope: async ({ kind }) => (kind === 'delete' ? 'this' : (await askScope()) ?? null),
});
declare function askScope(): Promise<'this' | 'following' | 'all' | null>;

In Angular and Vue it goes in options; in React it is a prop.