Class: ConditionCollection

ConditionCollection

handsontable-pro/src/plugins/filters/conditionCollection.js, line 9

Members

columnTypesObject

Types of operations grouped by column index.

conditionsObject

Conditions collection grouped by operation type and then column index.

orderStackArray

Order of added condition filters.

Methods

handsontable-pro/src/plugins/filters/conditionCollection.js, line 104

addCondition(column, conditionDefinition, operation)

Add condition to the collection.

Parameters:
Name Type Default Description
column Number

Column index.

conditionDefinition Object

Object with keys:

  • command Object, Command object with condition name as key property.
  • args Array, Condition arguments.
operation String 'conjunction' optional

Type of conditions operation

Fires:
  • ConditionCollection#event:beforeAdd
  • ConditionCollection#event:afterAdd
handsontable-pro/src/plugins/filters/conditionCollection.js, line 261

clean()

Clean all conditions collection and reset order stack.

Fires:
  • ConditionCollection#event:beforeClean
  • ConditionCollection#event:afterClean
handsontable-pro/src/plugins/filters/conditionCollection.js, line 221

clearConditions(column)

Clear conditions at specified column index but without clearing stack order.

Parameters:
Name Type Description
column Number

Column index.

Fires:
  • ConditionCollection#event:beforeClear
  • ConditionCollection#event:afterClear
handsontable-pro/src/plugins/filters/conditionCollection.js, line 272

destroy()

Destroy object.

handsontable-pro/src/plugins/filters/conditionCollection.js, line 167

exportAllConditions(){Array}

Export all previously added conditions.

Returns: {Array}
handsontable-pro/src/plugins/filters/conditionCollection.js, line 148

getConditions(column){Array}

Get all added conditions from the collection at specified column index.

Parameters:
Name Type Description
column Number

Column index.

Returns: {Array} Returns conditions collection as an array.
handsontable-pro/src/plugins/filters/conditionCollection.js, line 236

hasConditions(column, name){Boolean}

Check if at least one condition was added at specified column index. And if second parameter is passed then additionally
check if condition exists under its name.

Parameters:
Name Type Description
column Number

Column index.

name String optional

Condition name.

Returns: {Boolean}
handsontable-pro/src/plugins/filters/conditionCollection.js, line 187

importAllConditions()

Import conditions to the collection.

handsontable-pro/src/plugins/filters/conditionCollection.js, line 42

isEmpty(){Boolean}

Check if condition collection is empty (so no needed to filter data).

Returns: {Boolean}
handsontable-pro/src/plugins/filters/conditionCollection.js, line 53

isMatch(value, column){Boolean}

Check if value is matched to the criteria of conditions chain.

Parameters:
Name Type Description
value Object

Object with value and meta keys.

column Number optional

Column index.

Returns: {Boolean}
handsontable-pro/src/plugins/filters/conditionCollection.js, line 80

isMatchInConditions(conditions, value, operationType){Boolean}

Check if the value is matches the conditions.

Parameters:
Name Type Default Description
conditions Array

List of conditions.

value Object

Object with value and meta keys.

operationType String 'conjunction' optional

Type of conditions operation

Returns: {Boolean}
handsontable-pro/src/plugins/filters/conditionCollection.js, line 204

removeConditions(column)

Remove conditions at given column index.

Parameters:
Name Type Description
column Number

Column index.

Fires:
  • ConditionCollection#event:beforeRemove
  • ConditionCollection#event:afterRemove