ConditionCollection
Description
Initializes the condition collection with the Handsontable instance, optionally registering the filtering states index map on the column index mapper.
Members
filteringStates
conditionCollection.filteringStates : LinkedPhysicalIndexToValueMap
Index map storing filtering states for every column. ConditionCollection write and read to/from element.
Methods
addCondition
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
| Param | Type | Default | Description |
|---|---|---|---|
| column | number | The physical 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. |
| [position] | number | optional Position to which condition will be added. When argument is undefined the condition will be processed as the last condition. |
clean
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
conditionCollection.destroy()
Destroy object.
exportAllConditions
conditionCollection.exportAllConditions() ⇒ Array
Export all previously added conditions.
getColumnStackPosition
conditionCollection.getColumnStackPosition(column) ⇒ number
Gets position in the filtering states stack for the specific column.
| Param | Type | Description |
|---|---|---|
| column | number | The physical column index. |
Returns: number - Returns -1 when the column doesn’t exist in the stack.
getConditions
conditionCollection.getConditions(column) ⇒ Array
Get all added conditions from the collection at specified column index.
| Param | Type | Description |
|---|---|---|
| column | number | The physical column index. |
Returns: Array - Returns conditions collection as an array.
getFilteredColumns
conditionCollection.getFilteredColumns() ⇒ Array
Get all filtered physical columns in the order in which actions are performed.
getOperation
conditionCollection.getOperation(column) ⇒ string | undefined
Get operation for particular column.
| Param | Type | Description |
|---|---|---|
| column | number | The physical column index. |
hasConditions
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.
| Param | Type | Description |
|---|---|---|
| column | number | The physical column index. |
| [name] | string | optional Condition name. |
importAllConditions
conditionCollection.importAllConditions(conditions)
Import conditions to the collection.
| Param | Type | Description |
|---|---|---|
| conditions | Array | The collection of the conditions. |
isEmpty
conditionCollection.isEmpty() ⇒ boolean
Check if condition collection is empty (so no needed to filter data).
isMatch
conditionCollection.isMatch(value, column) ⇒ boolean
Check if value is matched to the criteria of conditions chain.
| Param | Type | Description |
|---|---|---|
| value | object | Object with value and meta keys. |
| column | number | The physical column index. |
isMatchInConditions
conditionCollection.isMatchInConditions(conditions, value, [operationType]) ⇒ boolean
Check if the value is matches the conditions.
| Param | Type | Default | Description |
|---|---|---|---|
| conditions | Array | List of conditions. | |
| value | object | Object with value and meta keys. | |
| [operationType] | string | ”conjunction” | optional Type of conditions operation. |
removeConditions
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
| Param | Type | Description |
|---|---|---|
| column | number | The physical column index. |