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