Class: DataProvider

DataProvider

Data class provider responsible for providing a set of range data types, necessary for calculating formulas.
Those methods strongly using hot.getData and hot.getSourceData methods with some changes. Data provider additionally
collects all changes added to the data source to make them available faster than by using
hot.getData and hot.getSourceData methods.

Members

changesObject

Collected changes applied into editors or by calling public Handsontable API. This is require to provide
fresh data applied into spreadsheet before they will be available from the public API.

hotCore

Handsontable instance.

hotCore

Handsontable instance.

optionsObject

Format type class options.

Record translator for translating visual records into psychical and vice versa.

Methods

clearChanges()

Clear all collected changes.

collectChanges(row, column, value)

Collect all data changes applied to the Handsontable to make them available later.

Parameters:
Name Type Description
row Number

Physical row index.

column Number

Physical column index.

value *

Value to store.

destroy()

Destroy class.

getColumnHeaders(){Array}

Gets list of columns headers.

Returns: {Array}

getData(){Array}

Get table data based on provided settings to the class constructor.

Returns: {Array}

getDataAtCell(visualRow, visualColumn){*}

Get calculated data at specified cell.

Parameters:
Name Type Description
visualRow Number

Visual row index.

visualColumn Number

Visual column index.

Returns: {*}

getDataByRange(visualRow1, visualColumn1, visualRow2, visualColumn2){Array}

Get calculated data at specified range.

Parameters:
Name Type Description
visualRow1 Number optional

Visual row index.

visualColumn1 Number optional

Visual column index.

visualRow2 Number optional

Visual row index.

visualColumn2 Number optional

Visual column index.

Returns: {Array}

getRawDataAtCell(visualRow, visualColumn){*}

Get source data at specified visual cell.

Parameters:
Name Type Description
visualRow Number

Visual row index.

visualColumn Number

Visual column index.

Returns: {*}

getRawDataByRange(visualRow1, visualColumn1, visualRow2, visualColumn2){Array}

Get source data at specified visual range.

Parameters:
Name Type Description
visualRow1 Number optional

Visual row index.

visualColumn1 Number optional

Visual column index.

visualRow2 Number optional

Visual row index.

visualColumn2 Number optional

Visual column index.

Returns: {Array}

getRowHeaders(){Array}

Gets list of row headers.

Returns: {Array}

getSourceDataAtCell(physicalRow, physicalColumn){*}

Get source data at specified physical cell.

Parameters:
Name Type Description
physicalRow Number

Physical row index.

physicalColumn Number

Physical column index.

Returns: {*}

getSourceDataByRange(physicalRow1, physicalColumn1, physicalRow2, physicalColumn2){Array}

Get source data at specified physical range.

Parameters:
Name Type Description
physicalRow1 Number optional

Physical row index.

physicalColumn1 Number optional

Physical column index.

physicalRow2 Number optional

Physical row index.

physicalColumn2 Number optional

Physical column index.

Returns: {Array}

isInDataRange(visualRow, visualColumn){Boolean}

Check if provided coordinates match to the table range data.

Parameters:
Name Type Description
visualRow Number

Visual row index.

visualColumn Number

Visual row index.

Returns: {Boolean}

setOptions(options)

Set options for data provider.

Parameters:
Name Type Description
options Object

Object with specified options.

updateSourceData(physicalRow, physicalColumn, value)

Update source data.

Parameters:
Name Type Description
physicalRow Number

Physical row index.

physicalColumn Number

Physical row index.

value *

Value to update.