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

A map with sampled table values.

addColumnHeadersRow(samples)

Add a row consisting of the column headers.

Parameters:
Name Type Description
samples Map

A map with sampled table values.

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

The CSS classes to add.

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

The CSS classes to add.

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

The setting name to get.

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

The element to which the ghost table is injected.

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.

Class: GhostTable