Skip to content

ConditionCollection

Description

Initializes the condition collection with the Handsontable instance, optionally registering the filtering states index map on the column index mapper.

Members

filteringStates

Source code

conditionCollection.filteringStates : LinkedPhysicalIndexToValueMap

Index map storing filtering states for every column. ConditionCollection write and read to/from element.

Methods

addCondition

Source code

conditionCollection.addCondition(column, conditionDefinition, [operation], [position])

Add condition to the collection.

Emits: [ConditionCollection#event](/docs/vue-data-grid/api/condition-collection/#event):beforeAdd, [ConditionCollection#event](/docs/vue-data-grid/api/condition-collection/#event):afterAdd

ParamTypeDefaultDescription
columnnumberThe physical column index.
conditionDefinitionobjectObject with keys: * command Object, Command object with condition name as key property. * args Array, Condition arguments.
[operation]string”conjunction”optional Type of conditions operation.
[position]numberoptional Position to which condition will be added. When argument is undefined the condition will be processed as the last condition.

clean

Source code

conditionCollection.clean()

Clean all conditions collection and reset order stack.

Emits: [ConditionCollection#event](/docs/vue-data-grid/api/condition-collection/#event):beforeClean, [ConditionCollection#event](/docs/vue-data-grid/api/condition-collection/#event):afterClean

destroy

Source code

conditionCollection.destroy()

Destroy object.

exportAllConditions

Source code

conditionCollection.exportAllConditions() ⇒ Array

Export all previously added conditions.

getColumnStackPosition

Source code

conditionCollection.getColumnStackPosition(column) ⇒ number

Gets position in the filtering states stack for the specific column.

ParamTypeDescription
columnnumberThe physical column index.

Returns: number - Returns -1 when the column doesn’t exist in the stack.

getConditions

Source code

conditionCollection.getConditions(column) ⇒ Array

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

ParamTypeDescription
columnnumberThe physical column index.

Returns: Array - Returns conditions collection as an array.

getFilteredColumns

Source code

conditionCollection.getFilteredColumns() ⇒ Array

Get all filtered physical columns in the order in which actions are performed.

getOperation

Source code

conditionCollection.getOperation(column) ⇒ string | undefined

Get operation for particular column.

ParamTypeDescription
columnnumberThe physical column index.

hasConditions

Source code

conditionCollection.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.

ParamTypeDescription
columnnumberThe physical column index.
[name]stringoptional Condition name.

importAllConditions

Source code

conditionCollection.importAllConditions(conditions)

Import conditions to the collection.

ParamTypeDescription
conditionsArrayThe collection of the conditions.

isEmpty

Source code

conditionCollection.isEmpty() ⇒ boolean

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

isMatch

Source code

conditionCollection.isMatch(value, column) ⇒ boolean

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

ParamTypeDescription
valueobjectObject with value and meta keys.
columnnumberThe physical column index.

isMatchInConditions

Source code

conditionCollection.isMatchInConditions(conditions, value, [operationType]) ⇒ boolean

Check if the value is matches the conditions.

ParamTypeDefaultDescription
conditionsArrayList of conditions.
valueobjectObject with value and meta keys.
[operationType]string”conjunction”optional Type of conditions operation.

removeConditions

Source code

conditionCollection.removeConditions(column)

Remove conditions at given column index.

Emits: [ConditionCollection#event](/docs/vue-data-grid/api/condition-collection/#event):beforeRemove, [ConditionCollection#event](/docs/vue-data-grid/api/condition-collection/#event):afterRemove

ParamTypeDescription
columnnumberThe physical column index.