Class: ColumnSummary

ColumnSummary

handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 14

Allows making pre-defined calculations on the cell values and display the results within Handsontable.
See the demo for more information.

Members

currentEndpointObject

The current endpoint (calculation destination point) in question.

Default Value:
  • null

endpointsArray

Array of declared plugin endpoints (calculation destination points).

Default Value:
  • {Array} Empty array.

settingsObject

The plugin settings, taken from Handsontable configuration.

Default Value:
  • null

Methods

handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 195

assignSetting(settings, endpoint, name, defaultValue)

Setter for the internal setting objects.

Parameters:
Name Type Description
settings Object

Object with the settings.

endpoint Object

Contains information about the endpoint for the the calculation.

name String

Settings name.

defaultValue

Default value for the settings.

handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 226

calculate(endpoint)

Do the math for a single endpoint.

Parameters:
Name Type Description
endpoint Object

Contains information about the endpoint.

handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 536

calculateAverage(endpoint){Number}

Calculate the average value from the cells in the range.

Parameters:
Name Type Description
endpoint Object

Contains the endpoint information.

Returns: {Number} Avarage value.
handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 418

calculateMinMax(endpoint, type){Number}

Calculate the minimal value for the selected ranges

Parameters:
Name Type Description
endpoint Object

Contains the endpoint information.

type String

'min' or 'max'.

Returns: {Number} Min or Max value.
handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 380

calculateSum(endpoint){Number}

Calculate sum of the values contained in ranges provided in the plugin config.

Parameters:
Name Type Description
endpoint Object

Contains the endpoint information.

Returns: {Number} Sum for the selected range
handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 489

countEmpty(rowRange, col){Number}

Count empty cells in the provided row range.

Parameters:
Name Type Description
rowRange Array

Row range for the calculation.

col Number

Column index.

Returns: {Number} Empty cells count.
handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 513

countEntries(endpoint){Number}

Count non-empty cells in the provided row range.

Parameters:
Name Type Description
endpoint Object

Contains the endpoint information.

Returns: {Number} Entry count.
handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 73

disablePlugin()

Disable the plugin.

handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 53

enablePlugin()

Enable plugin for this Handsontable instance.

handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 550

getCellValue(row, col){String}

Gets a cell value, taking into consideration a basic validation.

Parameters:
Name Type Description
row Number

Row index.

col Number

Column index.

Returns: {String} The cell value.
handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 454

getPartialMinMax(rowRange, col, type){Number}

Get a local minimum of the provided sub-range

Parameters:
Name Type Description
rowRange Array

Range for the calculation.

col Number

Column index.

type String

'min' or 'max'

Returns: {Number} Min or max value.
handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 399

getPartialSum(rowRange, col){Number}

Get partial sum of values from a single row range

Parameters:
Name Type Description
rowRange Array

Range for the sum.

col Number

Column index.

Returns: {Number} The partial sum.
handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 46

isEnabled(){Boolean}

Check if plugin is enabled.

Returns: {Boolean}
handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 166

parseSettings()

Parse plugin's settings.

handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 269

refreshAllEndpoints(init)

Calculate and refresh all defined endpoints.

Parameters:
Name Type Description
init Boolean

true if it's the initial call.

handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 283

refreshChangedEndpoints(changes)

Calculate and refresh endpoints only in the changed columns.

Parameters:
Name Type Description
changes Array

Array of changes from the afterChange hook.

handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 309

refreshEndpoint(endpoint)

Calculate and refresh a single endpoint.

Parameters:
Name Type Description
endpoint Object

Contains the endpoint information.

handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 254

resetAllEndpoints(endpoints)

Resets (removes) the endpoints from the table.

Parameters:
Name Type Description
endpoints Array

Array containing the endpoints.

handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 321

resetEndpointValue(endpoint)

Reset the endpoint value.

Parameters:
Name Type Description
endpoint Object

Contains the endpoint information.

handsontable-pro/src/plugins/columnSummary/columnSummary.js, line 342

setEndpointValue(endpoint, source)

Set the endpoint value.

Parameters:
Name Type Description
endpoint Object

Contains the endpoint information.

source String optional

Source of the call information.