Angular Scheduler - Appointment Edit Form

The appointment edit form allows users to modify or add appointments to the Scheduler's data source. The form contains two groups: the general information group (mainGroup) and the recurrence settings group (recurrenceGroup). Scheduler initially displays mainGroup and switches to the recurrenceGroup when users modify the "Repeat" drop-down value.

View Demo

Rearrange Form Items

Configure editing.form.items[] to customize the appointment edit form layout. To preserve the form's switching functionality between mainGroup and recurrenceGroup, add the groups as group items in the items[] root:

jQuery
index.js
$('#scheduler').dxScheduler({
    editing: {
        form: {
            items: [{
                name: 'mainGroup',
                itemType: 'group',
            }, {
                name: 'recurrenceGroup',
                itemType: 'group',
            }],
        },
    },
});
Angular
app.component.ts
<dx-scheduler>
    <dxo-scheduler-editing>
        <dxo-editing-form>
            <dxi-form-item
                name="mainGroup"
                itemType="group"
            ></dxi-form-item>
            <dxi-form-item
                name="recurrenceGroup"
                itemType="group"
            ></dxi-form-item>
        </dxo-editing-form>
    </dxo-scheduler-editing>
</dx-scheduler>
Vue
App.vue
<template>
    <DxScheduler>
        <DxEditing>
            <DxForm>
                <DxItem
                    name="mainGroup"
                    itemType="group"
                />
                <DxItem
                    name="recurrenceGroup"
                    itemType="group"
                />
            </DxForm>
        </DxEditing>
    </DxScheduler>
</template>

<script setup lang="ts">
import { DxScheduler, DxEditing, DxForm, DxItem } from 'devextreme-vue/scheduler';

</script>
React
App.tsx
import { Scheduler, Editing, Form, Item } from 'devextreme-react/scheduler';

function App() {
    return (
        <Scheduler>
            <Editing>
                <Form>
                    <Item
                        name="mainGroup"
                        itemType="group"
                    />
                    <Item
                        name="recurrenceGroup"
                        itemType="group"
                    />
                </Form>
            </Editing>
        </Scheduler>
    );
};

To add a resource field editor to items[], use the resource fieldExpr in an item name as follows:

jQuery
index.js
$('#scheduler').dxScheduler({
    resources: [{
        fieldExpr: 'priorityId'
    }],
    editing: {
        form: {
            items: [{
                name: 'mainGroup',
                itemType: 'group',
                items: [{
                    name: 'priorityIdGroup',
                    itemType: 'group',
                    items: ['priorityIdIcon', 'priorityIdEditor']
                }],
            }, ... ],
        },
    },
});
Angular
app.component.ts
<dx-scheduler>
    <dxo-scheduler-editing>
        <dxo-editing-form>
            <dxi-form-item
                name="mainGroup"
                itemType="group"
            >
                <dxi-form-item
                    name="priorityIdGroup"
                    itemType="group"
                >
                    <dxi-form-item name="priorityIdIcon"></dxi-form-item>
                    <dxi-form-item name="priorityIdEditor"></dxi-form-item>
                </dxi-form-item>
            </dxi-form-item>
        </dxo-editing-form>
    </dxo-scheduler-editing>
</dx-scheduler>
Vue
App.vue
<template>
    <DxScheduler>
        <DxEditing>
            <DxForm>
                <DxItem
                    name="mainGroup"
                    itemType="group"
                >
                    <DxItem
                        name="priorityIdGroup"
                        itemType="group"
                    >
                        <DxItem name="priorityIdIcon" />
                        <DxItem name="priorityIdEditor" />
                    </DxItem>
                </DxItem>
            </DxForm>
        </DxEditing>
    </DxScheduler>
</template>

<script setup lang="ts">
import { DxScheduler, DxEditing, DxForm, DxItem } from 'devextreme-vue/scheduler';

</script>
React
App.tsx
import { Scheduler, Editing, Form, Item } from 'devextreme-react/scheduler';

function App() {
    return (
        <Scheduler>
            <Editing>
                <Form>
                    <Item
                        name="mainGroup"
                        itemType="group"
                    >
                        <Item
                            name="priorityIdGroup"
                            itemType="group"
                        >
                            <Item name="priorityIdIcon" />
                            <Item name="priorityIdEditor" />
                        </Item>
                    </Item>
                </Form>
            </Editing>
        </Scheduler>
    );
};

Customize the Appointment Edit Form

To customize individual appointment edit form items, implement the onAppointmentFormOpening handler. The following code snippet uses AppointmentFormOpeningEvent.form to disable the subjectEditor input and enable isRequired for the descriptionEditor item:

jQuery
index.js
$('#scheduler').dxScheduler({
    onAppointmentFormOpening(e) {
        e.form.getEditor('subjectEditor').option('disabled', true);
        e.form.itemOption('mainGroup.descriptionGroup.descriptionEditor', 'isRequired', true);
    },
});
Angular
app.component.html
app.component.ts
<dx-scheduler ...
    (onAppointmentFormOpening)="handleAppointmentFormOpening($event)"
></dx-scheduler>
import { type DxSchedulerTypes } from "devextreme-angular/ui/scheduler";
// ...
export class AppComponent {
    handleAppointmentFormOpening(e: DxSchedulerTypes.AppointmentFormOpeningEvent) {
        e.form.getEditor('subjectEditor').option('disabled', true);
        e.form.itemOption('mainGroup.descriptionGroup.descriptionEditor', 'isRequired', true);
    }
}
Vue
App.vue
<template>
    <DxScheduler ...
        @appointment-form-opening="handleAppointmentFormOpening"
    />
</template>

<script setup lang="ts">
import { DxScheduler, type DxSchedulerTypes } from 'devextreme-vue/scheduler';

function handleAppointmentFormOpening(e: DxSchedulerTypes.AppointmentFormOpeningEvent) {
    e.form.getEditor('subjectEditor').option('disabled', true);
    e.form.itemOption('mainGroup.descriptionGroup.descriptionEditor', 'isRequired', true);
}

</script>
React
App.tsx
import { Scheduler, type SchedulerTypes } from 'devextreme-react/scheduler';

function handleAppointmentFormOpening(e: SchedulerTypes.AppointmentFormOpeningEvent) {
    e.form.getEditor('subjectEditor').option('disabled', true);
    e.form.itemOption('mainGroup.descriptionGroup.descriptionEditor', 'isRequired', true);
}

function App() {
    return (
        <Scheduler ...
            onAppointmentFormOpening={handleAppointmentFormOpening}
        />
    );
};
NOTE
Specify full item paths described in Predefined Items as the id parameter in itemOption().

To customize the appointment edit form further, specify the editing.form and editing.popup configuration objects. These objects configure the appointment edit form's Popup and Form components. The following code snippet increases the width of the Popup and sets the "static" label mode for the Form:

jQuery
index.js
$('#scheduler').dxScheduler({
    editing: {
        popup: {
            width: '50vw',
        },
        form: {
            labelMode: 'static',
        },
    },
});
Angular
app.component.html
<dx-scheduler>
    <dxo-scheduler-editing>
        <dxo-editing-popup
            width="50vw"
        ></dxo-editing-popup>
        <dxo-editing-form
            labelMode="static"
        ></dxo-editing-form>
    </dxo-scheduler-editing>
</dx-scheduler>
Vue
App.vue
<template>
    <DxScheduler>
        <DxEditing>
            <DxPopup width="50vw" />
            <DxForm labelMode="static" />
        </DxEditing>
    </DxScheduler>
</template>

<script setup lang="ts">
import { DxScheduler, DxEditing, DxForm, DxPopup } from 'devextreme-vue/scheduler';

</script>
React
App.tsx
import { Scheduler, Editing, Form, Popup } from 'devextreme-react/scheduler';

function App() {
    return (
        <Scheduler>
            <Editing>
                <Form width="50vw" />
                <Popup labelMode="static" />
            </Editing>
        </Scheduler>
    );
};

Predefined Items

The appointment edit form includes multiple predefined items. To integrate these, assign predefined item names to SimpleItem/GroupItem objects in the editing.form.items array. You can customize predefined items in their SimpleItem/GroupItem objects. To integrate predefined items without customization, add item names as strings.

The following predefined items are available:

editing.form.items
├─ mainGroup
|  ├─ subjectGroup
|  │  ├─ subjectIcon
|  │  └─ subjectEditor
|  ├─ dateGroup
|  │  ├─ dateIcon
|  |  └─ dateOptionsGroup
|  │     ├─ allDayEditor
|  │     ├─ startDateGroup
|  │     │  ├─ startDateTimeGroup
|  │     │  │  ├─ startDateEditor
|  │     │  │  └─ startTimeEditor
|  │     │  └─ startDateTimezoneEditor
|  │     └─ endDateGroup
|  │        ├─ endDateTimeGroup
|  │        │  ├─ endDateEditor
|  │        │  └─ endTimeEditor
|  │        └─ endDateTimezoneEditor
|  ├─ repeatGroup
|  │  ├─ repeatIcon
|  │  └─ repeatEditor
|  ├─ resourcesGroup
|  │  └─ ...
|  └─ descriptionGroup
|     ├─ descriptionIcon
|     └─ descriptionEditor
└─ recurrenceGroup
   ├─ recurrenceStartDateGroup
   │  ├─ recurrenceStartDateIcon
   │  └─ recurrenceStartDateEditor
   ├─ recurrenceRuleGroup
   │  ├─ recurrenceRuleIcon
   │  └─ recurrencePatternGroup
   │     ├─ recurrenceRuleRepeatGroup
   │     |  ├─ recurrenceCountEditor
   │     |  └─ recurrencePeriodEditor
   │     └─ recurrenceDayOfYearGroup — recurrenceDaysOfWeekEditor — recurrenceDayOfMonthEditor
   │        ├─ recurrenceDayOfYearMonthEditor
   │        └─ recurrenceDayOfYearDayEditor
   └─ recurrenceEndGroup
      ├─ recurrenceEndIcon
      └─ recurrenceEndEditor
         ├─ recurrenceRepeatEndEditor
         └─ recurrenceEndEditorsGroup
            ├─ recurrenceEndSpacer
            ├─ recurrenceEndUntilEditor
            └─ recurrenceEndCountEditor

Items within resourcesGroup depend on resource fieldExpr and icon properties. Scheduler uses resource field expressions (for instance, "roomId") in item names as follows:

...
└─ resourcesGroup
   └─ roomIdGroup
      ├─ roomIdIcon
      └─ roomIdEditor

If no resource has an icon assigned, resourcesGroup contains the following items:

...
└─ resourcesGroup
   ├─ resourcesGroupIcon
   └─ resourceEditorsGroup
      ├─ roomIdEditor
      ├─ priorityIdEditor
      ├─ assigneeIdEditor
      └─ ...

View Demo

The images below illustrate predefined items within each available group.

General Appointment Details

General appointment details are available in the mainGroup:

Scheduler appointment edit form, main group
  1. mainGroup

Appointment Recurrence Settings

Appointment recurrence settings are available in the recurrenceGroup:

Scheduler appointment edit form, recurrence group
  1. recurrenceGroup

Subject

Scheduler appointment edit form, subject group items
  1. subjectGroup
  2. subjectIcon
  3. subjectEditor

Date

Scheduler appointment edit form, date group items
  1. dateGroup
  2. dateIcon
  3. dateOptionsGroup
  4. allDayEditor
  5. startDateGroup
  6. endDateGroup

Recurrence

Scheduler appointment edit form, repeat group items
  1. repeatGroup
  2. repeatIcon
  3. repeatEditor

Resources

Scheduler appointment edit form, resources groups.
  1. resourcesGroup
  2. roomIdGroup
  3. priorityIdGroup
  4. assigneeIdGroup
Scheduler appointment edit form, resources group items.
  1. roomIdGroup
  2. roomIdIcon
  3. roomIdEditor
  4. priorityIdGroup
  5. priorityIdIcon
  6. priorityIdEditor
  7. assigneeIdGroup
  8. assigneeIdIcon
  9. assigneeIdEditor

The following image demonstrates a compact resourcesGroup layout:

Scheduler appointment edit form, resources group items, alternative layout.
  1. resourcesGroup
  2. roomIdGroup
  3. priorityIdEditor

The following image demonstrates resourcesGroup items when no resource icons are specified:

Scheduler appointment edit form, resources group items, no individual resource icons.
  1. resourcesGroup
  2. resourcesGroupIcon
  3. resourceEditorsGroup

Description

Scheduler appointment edit form, description group items
  1. descriptionGroup
  2. descriptionIcon
  3. descriptionEditor

Start Date

Scheduler appointment edit form, start date group items
  1. startDateGroup
  2. startDateTimeGroup
  3. startDateTimezoneEditor
  4. startDateEditor
  5. startTimeEditor

End Date

Scheduler appointment edit form, end date group items
  1. endDateGroup
  2. endDateTimeGroup
  3. endDateTimezoneEditor
  4. endDateEditor
  5. endTimeEditor

Recurrence Start Date

Scheduler appointment edit form, recurrence start date group items
  1. recurrenceStartDateGroup
  2. recurrenceStartDateIcon
  3. recurrenceStartDateEditor

Recurrence Rules - Common Items

The following image demonstrates recurrenceRuleGroup items that are displayed in all recurrence modes:

Scheduler appointment edit form, recurrence rule group items displayed in all recurrence modes
  1. recurrenceRuleGroup
  2. recurrenceRuleIcon
  3. recurrencePatternGroup
    └─ recurrenceRuleRepeatGroup
  4. recurrenceCountEditor
NOTE
recurrenceCountEditor is nested within recurrenceRuleRepeatGroup.

Recurrence Rules - Mode-Specific Options

The following image demonstrates recurrenceRuleGroup items specific to each recurrence mode:

Scheduler appointment edit form, recurrence rule group items specific to each recurrence mode
  1. recurrencePeriodEditor - Daily Recurrence
  2. recurrencePeriodEditor - Weekly Recurrence
  3. recurrenceDaysOfWeekEditor
  4. recurrencePeriodEditor - Monthly Recurrence
  5. recurrenceDayOfMonthEditor
  6. recurrencePeriodEditor - Yearly Recurrence
  7. recurrenceDayOfYearGroup
  8. recurrenceDayOfYearMonthEditor
  9. recurrenceDayOfYearDayEditor
NOTE
All items except recurrencePeriodEditor are nested within recurrencePatternGroup.

Recurrence End Date

Scheduler appointment edit form, recurrence end date group items
  1. recurrenceEndGroup
  2. recurrenceEndIcon
  3. recurrenceEndEditor
Scheduler appointment edit form, recurrence end date editor items
  1. recurrenceEndEditor
  2. recurrenceRepeatEndEditor
  3. recurrenceEndEditorsGroup
  4. recurrenceEndSpacer
  5. recurrenceEndUntilEditor
  6. recurrenceEndCountEditor