The React Scheduler allows users to create, update, and delete appointments. The editing state contains information about pending changes made to an appointment and is managed by the
EditingState plugin. Once a user clicks Save or Delete, the plugin fires the
onCommitChanges event and clears the editing state.
The following plugins implement this feature:
The user can edit appointments as follows:
Add the plugins listed above to the Scheduler and handle the
onCommitChanges event to commit edits to the data storage.
In uncontrolled mode, specify the initial editing state via the following
defaultEditingAppointment- the appointment being edited
defaultAddedAppointment- the appointment being added
defaultAppointmentChanges- changes made to the appointment
In controlled mode, specify the following
EditingState properties in pairs to set a state value and handle the event when it changes:
onEditingAppointmentChange- the appointment being edited
onAddedAppointmentChange- the appointment being added
onAppointmentChangesChange- changes made to the appointment
You can also use the
onAddedAppointmentChange event to initialize a new appointment’s properties with default values.
Add the DragDropProvider plugin to enable users to drag and drop appointments. Use its
allowResize properties to disallow dragging and resizing specific appointments. You can also add the
EditRecurrenceMenu plugin to allow users to specify how recurrent appointments are edited.
The DragDropProvider plugin also allows you to customize the appointment being dragged (via the
draftAppointmentComponent property) and its copy displayed in its previous location (via
sourceAppointmentComponent). In addition, it provides the
resizeComponent property that allows you to customize the handles used to resize appointments.
To validate user input or prevent user actions, handle the
For example, you can copy an appointment if it was drag-and-dropped while a specific key was pressed (the
shift key is used in the demo below). To detect the drop event, check the
changed parameter’s value in the
To add and remove editors to/from the appointment form or change its layout, use components the
AppointmentForm plugin provides. They include editors for Boolean values, text, and dates, multi-choice editors, and several layout components.
The following demo shows how to customize the appointment form. A custom
TextEditor with a
Label is added to the form’s
BasicLayout and a predefined
multilineTextEditor is removed from it.
To enable the confirmation dialog, add the ConfirmationDialog plugin. The dialog pops up when a user attempts to delete an appointment or discard edits made to it. If the dialog should not appear in these cases, set the
ignoreCancel property to