Class: SimpleFilterDescriptor

SimpleFilterDescriptor(columnIndex, compareValue, operationopt, columnTypeopt)

Generic implementation of FilterDescriptor. Filters cells for the given columnIndex by comparing their values to the given compareValue using the given operation. The values for individual cells are determined based upon columnType.

Operation is a string, and must be one of the following:

  • '=' (Equals)
  • '>' (Greater Than)
  • '<' (Less Than)
  • '>=' (Greater Than Or Equal To)
  • '<=' (Less Than Or Equal To)
  • '!=' (Not Equals)
  • '~' (Contains, Ignore Case)
  • '~~' (Contains, Case Sensitive)

Constructor

new SimpleFilterDescriptor(columnIndex, compareValue, operationopt, columnTypeopt)

Parameters:
Name Type Attributes Default Description
columnIndex number

Column index this SimpleFilterDescriptor describes.

compareValue *

Value to which cells are to be compared.

operation string <optional>
'='

String indicating the operation this filter is to perform. Must be one of the following: '=', '!=' '<', '>' '<=', '>=', '~', or '~~'.

columnType number <optional>
HTMLTableWrapperUtils.COLUMN_TYPE_INFER

How the values of cells in this column are to be determined.

Implements:
Source:

Members

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:

columnType :number

How individual cell values are to be converted. If HTMLTableWrapperUtils.COLUMN_TYPE_TEXT, cell values will be treated only as text; if HTMLTableWrapperUtils.COLUMN_TYPE_INFER (default), an attempt will be made to convert cell values to numbers prior to evaluating filter conditions.

Type:
  • number
Source:

compareValue :*

Value against which individual cell values are to be compared.

Type:
  • *
Source:

operation :string

Operation this SimpleFilterDescriptor is to perform when determining whether to filter a cell. Valid values are described in this class' description.

Type:
  • string
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