Retrieves the GUIDs of the selected data fields.
This method returns an array of GUIDs corresponding to the selected data fields in the filter.
An array of GUIDs of the selected data fields.
const filterControl = ix.api.dom.getControl("<CONTROL-GUID>");
const selectedDatafields = filterControl.getSelectedDatafields();
Retrieves the key of the selected comparative operator.
The key corresponding to the currently selected operator in the filter or undefined
if no operator is selected.
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
.
The selected operator option, or undefined
if no operator is selected.
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
.
The enabled status of the control.
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.
An array of GUIDs of the data fields to be selected.
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.
Optional
key: OperatorKeyThe key of the operator to be selected. If not provided, the operator is deselected.
A boolean indicating whether the operator key was successfully updated to the provided key.
const filterControl = ix.api.dom.getControl("<CONTROL-GUID>");
filterControl.selectOperator("=");
Sets the search value.
This asynchronous method updates the search value of the filter.
The new search value.
A promise that resolves to a boolean indicating whether the search value was successfully set to the term.
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
.
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.
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")
});
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: