Class: ColumnValueFilter

(private) HTMLTableWrapperControl.ColumnValueFilter(columnIndex, operator, compareValue, columnType, selectedValues, cellInterpreteropt)

The FilterDescriptor implementation returned by HTMLTableWrapperControl#getFilterDescriptor. Determines whether individual cell values should be filtered based upon the given operator, compareValue, selectedValues and columnType. Individual cell values are determined with the given cellInterpreter if present. If no value is given for cellInterpreter, each cell's value is its trimmed textContent.

Constructor

(private) new ColumnValueFilter(columnIndex, operator, compareValue, columnType, selectedValues, cellInterpreteropt)

Parameters:
Name Type Attributes Default Description
columnIndex number

Column index of the parent HTMLTableWrapperControl.

operator number

HTMLTableWrapperUtils.FILTER_OP_* and FILTER_FLAG_* combination representing the current selected operator.

compareValue string

User-entered filter value.

columnType number

HTMLTableWrapperUtils.COLUMN_TYPE_* constant representing the current selected column type.

selectedValues Array

A list of values currently selected in the Excel-like filter portion of the parent control.

cellInterpreter CellInterpreter | HTMLTableWrapperControl~populateCellValues <optional>
null

CellInterpreter or callback of the parent HTMLTableWrapperControl.

Implements:
Source:

Members

(private) cellInterpreter :CellInterpreter|HTMLTableWrapperControl~populateCellValues

CellInterpreter or callback of the parent HTMLTableWrapperControl.

Type:
Source:

columnIndex :number

Optional property indicating the index of the column this FilterDescriptor describes how to filter. If this property is not a positive number, it will be assumed this FilterDescriptor describes how to filter entire rows.

Type:
  • number
Implements:
Source:

(private) columnType :number

HTMLTableWrapperUtils.COLUMN_TYPE_* constant representing the current selected column type.

Type:
  • number
Source:

(private) compareValue :string

User-entered filter value.

Type:
  • string
Source:

(private) currentCellCache :ColumnValueSet

ColumnValueSet to use with the configured HTMLTableWrapperControl.ColumnValueFilter#cellInterpreter, if present. (Prevents the need to create a new ColumnValueSet on each call to HTMLTableWrapperControl.ColumnValueFilter#include when filtering). This property is null if no cellInterpreter is configured.

Type:
Source:

(private) operator :number

HTMLTableWrapperUtils.FILTER_OP_* and FILTER_FLAG_* combination representing the current selected operator.

Type:
  • number
Source:

(private) selectedValues :Array

A list of values currently selected in the Excel-like filter portion of the parent control.

Type:
  • Array
Source:

Methods

include(item) → {boolean}

Callback function to determine whether the given row or cell's parent row should be filtered. If FilterDescriptor#columnIndex is defined, and a postiive number, the HTMLTableCellElement in the approprite position within the row being considered will be passed to this function corresponding to this FilterDescriptor's FilterDescriptor#columnIndex property, otherwise the HTMLTableRowElement being considered will be passed directly.

If this function returns false, the relevant row will be filtered.

Parameters:
Name Type Description
item HTMLCellElement | HTMLTableRowElement

Cell or Row to be considered for inclusion.

Implements:
Source:
Returns:

false if the given item should be filtered.

Type
boolean

(private) shouldInclude(cellValue) → {boolean}

Utility function to test whether an individual cell value qualifies it for inclusion in a filtering operation.

Parameters:
Name Type Description
cellValue string

Cell value to test.

Source:
Returns:

false if the cell containing the given cellValue should be filtered, otherwise true.

Type
boolean