Class: GhostTable

GhostTable

Members

columnsArray

Added columns collection.

container*

Temporary element created to get minimal headers widths.

containerHTMLElement null

Container element where every table will be injected.

hotCore

Handsontable instance.

injectedBoolean

Flag which determine is table was injected to DOM.

nestedHeadersNestedHeaders

Reference to NestedHeaders plugin.

rowsArray

Added rows collection.

samplesMap

Samples prepared for calculations.

Default Value: {null}

settingsObject

Ghost table settings.

Default Value: {Object}

widthsCacheArray

Cached the headers widths.

Methods

addColumn(column, samples)

Add column.

Parameters:
Name Type Description
column Number

Column index.

samples Map

Samples Map object.

addColumnHeadersRow()

Add a row consisting of the column headers.

addRow(row, samples)

Add row.

Parameters:
Name Type Description
row Number

Row index.

samples Map

Samples Map object.

clean()

Remove table from document and reset internal state.

clear()

Clear the widths cache.

createCol(column){DocumentFragment}

Create table column elements.

Parameters:
Name Type Description
column Number

Column index.

Returns: {DocumentFragment} Returns created column table column elements.

createColElement(column){HTMLElement}

Create col element.

Parameters:
Name Type Description
column Number

Column index.

Returns: {HTMLElement}

createColGroupsCol(){DocumentFragment}

Create colgroup col elements.

Returns: {DocumentFragment}

createContainer(className){Object}

Create container for tables.

Parameters:
Name Type Description
className String
Returns: {Object}

createRow(row){DocumentFragment}

Create table row element.

Parameters:
Name Type Description
row Number

Row index.

Returns: {DocumentFragment} Returns created table row elements.

createTable(className){Object}

Create table element.

Parameters:
Name Type Description
className String
Returns: {Object}

getHeights(callback)

Get calculated heights.

Parameters:
Name Type Description
callback function

Callback which will be fired for each calculated row.

getSetting(name){Boolean|null}

Get a single Ghost Table setting.

Parameters:
Name Type Description
name String
Returns: {Boolean|null}

getSettings(){Object|null}

Get the Ghost Table settings.

Returns: {Object|null}

getWidths(callback)

Get calculated widths.

Parameters:
Name Type Description
callback function

Callback which will be fired for each calculated column.

injectTable(parent)

Inject generated table into document.

Parameters:
Name Type Default Description
parent HTMLElement optional

isHorizontal(){Boolean}

Checks if table is raised horizontally (checking columns).

Returns: {Boolean}

isVertical(){Boolean}

Checks if table is raised vertically (checking rows).

Returns: {Boolean}

removeTable()

Remove table from document.

setSetting(name, value)

Set a single setting of the Ghost Table.

Parameters:
Name Type Description
name String

Setting name.

value *

Setting value.

setSettings(settings)

Set the Ghost Table settings to the provided object.

Parameters:
Name Type Description
settings Object

New Ghost Table Settings