Skip to content

ConditionUpdateObserver

Description

Class which is designed for observing changes in condition collection. When condition is changed by user at specified column it’s necessary to update all conditions defined after this edited one.

Object fires update hook for every column conditions change.

Description

Initializes the observer with the Handsontable instance, a condition collection to watch, and an optional factory for column source data.

Members

changes

Source code

conditionUpdateObserver.changes : Array

Collected changes when grouping is enabled.

Default: []

grouping

Source code

conditionUpdateObserver.grouping : boolean

Flag which determines if grouping events is enabled.

latestEditedColumnPosition

Source code

conditionUpdateObserver.latestEditedColumnPosition : number

The latest known position of edited conditions at specified column index.

Default: -1

latestOrderStack

Source code

conditionUpdateObserver.latestOrderStack : Array

The latest known order of conditions stack.

Methods

destroy

Source code

conditionUpdateObserver.destroy()

Destroy instance.

flush

Source code

conditionUpdateObserver.flush()

Flush all collected changes. This trigger update hook for every previously collected change from condition collection.

groupChanges

Source code

conditionUpdateObserver.groupChanges()

Enable grouping changes. Grouping is helpful in situations when a lot of conditions is added in one moment. Instead of trigger update hook for every condition by adding/removing you can group this changes and call flush method to trigger it once.

updateStatesAtColumn

Source code

conditionUpdateObserver.updateStatesAtColumn(column, conditionArgsChange)

Update all related states which should be changed after invoking changes applied to current column.

ParamTypeDescription
columnnumberThe column index.
conditionArgsChangeobjectObject describing condition changes which can be handled by filters on update hook. It contains keys conditionKey and conditionValue which refers to change specified key of condition to specified value based on referred keys.