Interface ControlStateApi

Methods and properties related to the state of the control.

interface ControlStateApi {
    allowInput: boolean;
    couldBeReadOnly: boolean;
    couldBeRequired: boolean;
    disabled: boolean;
    hidden: boolean;
    maskActive: boolean;
    readOnly: boolean;
    required: boolean;
    get<T>(state: T): undefined | boolean;
    onChange(handler: ((change: StateChange) => void)): void;
    update(): void;
}

Properties

allowInput: boolean

Checks if the current controls should allow input. Returns true if the control allows input, otherwise false.

couldBeReadOnly: boolean

Returns if this control could be read-only based on a condition. True if the control could be read-only, otherwise false.

couldBeRequired: boolean

Returns if this control could be required based on a condition. True if the control could be required, otherwise false.

disabled: boolean

Returns the disabled state of the calling control. True if the control is disabled, otherwise false.

hidden: boolean

Returns the hidden state of the calling control. True if the control is hidden, otherwise false.

maskActive: boolean

Returns the masked state of the calling control. True if the control is masked, otherwise false.

use api.control.masking.isMasked

readOnly: boolean

Returns the read-only state of the calling control. True if the control is read-only, otherwise false.

required: boolean

Returns the required state of the calling control. True if control is required, otherwise false.

Methods

  • Returns the state with a specified key.

    Type Parameters

    • T extends keyof IControlClientStates

    Parameters

    • state: T

      {string} The key of the state to be returned.

    Returns undefined | boolean

    The specified state of the calling control, or undefined if no match.

  • Registers a function to be invoked whenever a state change event occurs. This function receives an object that contains information about the change event.

    Parameters

    • handler: ((change: StateChange) => void)

      {function} Function to be invoked when a state is changed. Parameter (change: StateChange). Returns void.

        • (change): void
        • Parameters

          Returns void

    Returns void

  • Re-evaluates the status of all control states.

    Returns void