Formulas

The formulas plugin.

Methods

destroy()

Destroys the plugin instance.

disablePlugin()

Disables the plugin functionality for this Handsontable instance.

enablePlugin()

Enables the plugin functionality for this Handsontable instance.

getCellValue(row, column){*}

Returns cell value (evaluated from formula expression) at specified cell coords.

Parameters:
Name Type Description
row number

Row index.

column number

Column index.

Returns: {*}

getVariable(name){*}

Returns variable name.

Parameters:
Name Type Description
name string

Variable name.

Returns: {*}

hasComputedCellValue(row, column){boolean}

Checks if there are any formula evaluations made under specific cell coords.

Parameters:
Name Type Description
row number

Row index.

column number

Column index.

Returns: {boolean}

isEnabled(){boolean}

Checks if the plugin is enabled in the handsontable settings. This method is executed in Hooks#beforeInit
hook and if it returns true than the Formulas#enablePlugin method is called.

Returns: {boolean}

recalculate()

Recalculates all formulas (an algorithm will choose the best method of calculation).

recalculateFull()

Recalculates all formulas (rebuild dependencies from scratch - slow approach).

recalculateOptimized()

Recalculates all formulas (recalculate only changed cells - fast approach).

setVariable(name, value)

Sets predefined variable name which can be visible while parsing formula expression.

Parameters:
Name Type Description
name string

Variable name.

value *

Variable value.

Class: Formulas