Represents a sortable list control.

This control provides a user-friendly interface for manipulating the order of items in a list and saving the selected item's value to a data field.

Hierarchy

  • UpDataEditControl
    • SortableList

Implements

  • UpSortableListControl

Accessors

  • get required(): boolean
  • Check if control is required or not.

    Returns boolean

    Example

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

    Parameters

    • value: boolean

    Returns void

    Example

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

Methods

  • Verifies the validity of the control.

    Returns Promise<ValidationInfo>

    Example

    var 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'
    }
  • Fetches all the elements in the sortable list.

    Returns HTMLLIElement[]

    Example

    var ctrl = ix.api.dom.getControl("<ELEMENT-GUID>");
    var entries = ctrl.getEntries();
  • Retrieves the record ID of the currently selected entry.

    Returns string

    Example

    var ctrl = ix.api.dom.getControl("<ELEMENT-GUID>");
    ctrl.getValue();
  • Refreshes the sortable list to reflect any changes.

    Returns Promise<unknown>

    Example

    var ctrl = ix.api.dom.getControl("<ELEMENT-GUID>");
    ctrl.reload();
  • Marks an element as selected and updates the value in the input field.

    Parameters

    • id: string | number

      The ID of the entry to be marked as selected.

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

      Optional parameter to determine if the onchange event should be triggered.

      • Optional triggerOnchange?: "disabled" | "strict" | "always"

    Returns void

    Example

    var ctrl = ix.api.dom.getControl("<ELEMENT-GUID>");
    ctrl.setValue("<DATA-ITEM-KEY>");