Represents the "Operator Filter" control.

It is used to create a filter that can compare a view table with an operation, which is connected to the filter via a dependency.

The filter consists of three fields:

  1. Selection of the data field whose values are to be compared.
  2. Operator for the comparison.
  3. Value for which the table is being filtered.

Hierarchy

  • UpControl
    • Operator

Implements

  • Disableable

Methods

  • Deactivates the control and its associated elements (data field, operator and search).

    Returns void

    Example

    const filterControl = ix.api.dom.getControl("<CONTROL-GUID>");
    filterControl.disable();
  • Activates the control and its associated elements (data field, operator and search).

    Returns void

    Example

    const filterControl = ix.api.dom.getControl("<CONTROL-GUID>");
    filterControl.enable();
  • Retrieves the current value of the search field in the filter.

    Returns undefined | string

    Example

    const filterControl = ix.api.dom.getControl("<CONTROL-GUID>");
    const searchValue = filterControl.getSearchValue();
  • Retrieves the GUIDs of the selected data fields.

    This method returns an array of GUIDs corresponding to the selected data fields in the filter.

    Returns string[]

    An array of GUIDs of the selected data fields.

    Example

    const filterControl = ix.api.dom.getControl("<CONTROL-GUID>");
    const selectedDatafields = filterControl.getSelectedDatafields();
  • Retrieves the key of the selected comparative operator.

    Returns undefined | OperatorKey

    The key corresponding to the currently selected operator in the filter or undefined if no operator is selected.

    Example

    const filterControl = ix.api.dom.getControl("<CONTROL-GUID>");
    const selectedOperator = filterControl.getSelectedOperator();
  • Retrieves the selected comparative operator.

    This method returns the operator option corresponding to the current operator key. If the operator key is null, it returns undefined.

    Returns undefined | OperatorOption

    The selected operator option, or undefined if no operator is selected.

    Example

    const filterControl = ix.api.dom.getControl("<CONTROL-GUID>");
    const selectedOperatorObject = filterControl.getSelectedOperatorObject();
  • Checks if the control is enabled or disabled.

    This method returns a boolean indicating the status of the control. If the control is enabled, it returns true. If the control is disabled, it returns false.

    Returns boolean

    The enabled status of the control.

    Example

    const filterControl = ix.api.dom.getControl("<CONTROL-GUID>");
    const isEnabled = filterControl.isEnabled();
  • Sets the selected data fields using their GUIDs.

    This method accepts an array of GUIDs and updates the selected data fields in the filter accordingly. If multiple GUIDs are provided but multiple selection is not allowed, only the first GUID is used. The method also rebuilds the UI and sets the operators if the selected data fields have changed.

    Parameters

    • guids: string[]

      An array of GUIDs of the data fields to be selected.

    Returns void

    Example

    const filterControl = ix.api.dom.getControl("<CONTROL-GUID>");
    filterControl.selectDatafields(["<DATAFIELD1-GUID>", "<DATAFIELD2-GUID>"]);
  • Selects a comparative operator by its key.

    This method accepts an optional key for an operator. If the provided key differs from the current operator key, it updates the operator key, rebuilds the operator UI, and rebuilds the search UI.

    Parameters

    • Optional key: OperatorKey

      The key of the operator to be selected. If not provided, the operator is deselected.

    Returns boolean

    A boolean indicating whether the operator key was successfully updated to the provided key.

    Example

    const filterControl = ix.api.dom.getControl("<CONTROL-GUID>");
    filterControl.selectOperator("=");
  • Sets the search value.

    This asynchronous method updates the search value of the filter.

    Parameters

    • term: string

      The new search value.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating whether the search value was successfully set to the term.

    Example

    const filterControl = ix.api.dom.getControl("<CONTROL-GUID>");
    filterControl.setSearchValue("search term").then((success) => {
    console.log(success);
    });
  • Triggers the 'change' event.

    This asynchronous method fires the 'onchange' event associated with the control. By default, the event is only fired if the control is valid (i.e., duly completed). However, you can force the event to fire regardless of the control's validity by setting the forceEvent parameter to true.

    Parameters

    • forceEvent: boolean = false

      If true, the 'onchange' event is fired regardless of the control's validity. If false or omitted, the event is only fired if the control is valid.

    Returns Promise<void>

    Example

    const filterControl = ix.api.dom.getControl("<CONTROL-GUID>");

    // Fire 'onchange' event if control is valid
    filterControl.triggerOnchange().then(() => {
    console.log("onchange event fired");
    });

    // Fire 'onchange' event regardless of control's validity
    filterControl.triggerOnchange(true).then(() => {
    console.log("onchange event forced")
    });