formcycle 8.4.0 - JavaScript for forms
    Preparing search index...

    Interface AppointmentPickerApiLifecycle

    (advanced) Provides functions related to the lifecycle of an appointment picker, such as initializing a new picker on a DOM element, getting the ID of an existing picker, or destroying an existing picker.

    Available via $.xutil.appointmentPicker.lifecycle.

    interface AppointmentPickerApiLifecycle {
        destroy: (picker: any) => void;
        getInstanceId: (picker: any) => string;
        getInstanceIds: (picker: any) => readonly string[];
        hasAnyActivePicker: (picker: any) => boolean;
        initialize: (
            element: any,
            options?: Partial<AppointmentPickerOptionsInitOptions>,
        ) => string[];
    }
    Index

    Properties

    destroy: (picker: any) => void

    Destroys the given appointment pickers.

    Type declaration

      • (picker: any): void
      • Parameters

        • picker: any

          A reference to the appointment pickers to destroy.

        Returns void

    getInstanceId: (picker: any) => string

    Finds the instance IDs of the first appointment picker from the given reference.

    Type declaration

      • (picker: any): string
      • Parameters

        • picker: any

          A reference to the appointment picker to process.

        Returns string

        The instance IDs of the first appointment picker, or undefined when the given reference does not resolve to any appointment pickers.

    getInstanceIds: (picker: any) => readonly string[]

    Finds all instance IDs of the appointment picker for the given reference.

    When the reference resolves to multiple appointment pickers, the IDs are returned in the order of the given references.

    Type declaration

      • (picker: any): readonly string[]
      • Parameters

        • picker: any

          A reference to the appointment picker to process.

        Returns readonly string[]

        All instance IDs of the given appointment pickers.

    hasAnyActivePicker: (picker: any) => boolean

    Checks whether the given reference represents an existing appointment picker.

    Type declaration

      • (picker: any): boolean
      • Parameters

        • picker: any

          A reference to the appointment picker to check.

        Returns boolean

        true when the given reference represents at least one active appointment picker, false otherwise.

    initialize: (
        element: any,
        options?: Partial<AppointmentPickerOptionsInitOptions>,
    ) => string[]

    Initializes an element as an appointment picker and displays it.

    Creates a new picker instance and attaches the given element as a view for that picker.

    The initial settings for the appointment picker are read from various sources, such as the current environment (the current time), the default settings of the JQueryUI datepicker (date format), the I18N variables (localized messages), the XFC metadata (session ID and AJAX endpoint URLs); as well as from the given DOM element (data provided by the server, such as whether the picker is closable).

    The given options always take precedence over all other option sources.

    Returns the instance ID of the newly created picker. The ID is unique within the scope of a page's global window context. The ID can be given to the various methods offered by this module to perform operations on the appointment picker.

    When an appointment picker was already initialized, does nothing and simply returns its ID.

    Type declaration

      • (element: any, options?: Partial<AppointmentPickerOptionsInitOptions>): string[]
      • Parameters

        • element: any

          A DOM element to convert to an appointment picker. Should be a container element such as a div.

        • Optionaloptions: Partial<AppointmentPickerOptionsInitOptions>

          Optional settings for the newly created appointment picker.

        Returns string[]

        The instance ID for each of the newly created pickers.