The checkbox control is a fundamental UI element that allows users to select or deselect an option. It is typically used to represent Boolean data (true/false or yes/no). The state of the checkbox (checked or unchecked) reflects the underlying Boolean value it is associated with.

This control can function both as an input element, allowing users to change the value, and as a view element, displaying the current value. The visual representation of the checkbox in the browser (selected or not selected) corresponds to the Boolean value it represents.

Hierarchy

  • UpDataEditControl
    • Checkbox

Properties

Accessors

Methods

Properties

element: HTMLInputElement

Accessors

  • get required(): boolean
  • Check if input is required.

    Returns boolean

    Example

    var ctrl = ix.api.dom.getControl("<ELEMENT-GUID>");
    console.log(ctrl.required);
  • set required(value): void
  • Set input required / not required.

    Parameters

    • value: boolean

    Returns void

    Example

    var ctrl = ix.api.dom.getControl("<ELEMENT-GUID>");
    ctrl.required = true;

Methods

  • Set the state of the element to checked.

    Parameters

    • Optional settings: {
          triggerOnchange: "disabled" | "strict" | "always";
      }
      • triggerOnchange: "disabled" | "strict" | "always"

    Returns void

    Example

    var ctrl = ix.api.dom.getControl("<ELEMENT-GUID>");
    ctrl.check();
  • Checks control validity.

    Returns Promise<ValidationInfo>

    Example

    const validityResult = await ix.api.dom.getControl("<GUID>").checkValidity();

    // example of `validityResult` - field is required, but was not filled
    ValidationInfo {
    valStatus: false,
    valMessage: 'Please make a selection',
    valType: 'required'
    }
  • Get the elements checked state.

    Returns boolean

    Example

    var ctrl = ix.api.dom.getControl("<ELEMENT-GUID>");
    console.log(ctrl.isChecked());
  • Toggle the state of the element.

    Parameters

    • Optional settings: {
          triggerOnchange: "disabled" | "strict" | "always";
      }
      • triggerOnchange: "disabled" | "strict" | "always"

    Returns void

    Example

    var ctrl = ix.api.dom.getControl("<ELEMENT-GUID>");
    ctrl.toggle();
  • Set the state of the element to unchecked.

    Parameters

    • Optional settings: {
          triggerOnchange: "disabled" | "strict" | "always";
      }
      • triggerOnchange: "disabled" | "strict" | "always"

    Returns void

    Example

    var ctrl = ix.api.dom.getControl("<ELEMENT-GUID>");
    ctrl.uncheck();