Skip to content

GhostTable

Description

Initializes the ghost table utility with a reference to the Handsontable instance used for DOM context.

Members

columns

Source code

ghostTable.columns : Array

Added columns collection.

container

Source code

ghostTable.container : HTMLElement | null

Container element where every table will be injected.

hot

Source code

ghostTable.hot : Core

Handsontable instance.

injected

Source code

ghostTable.injected : boolean

Flag which determine is table was injected to DOM.

rows

Source code

ghostTable.rows : Array

Added rows collection.

samples

Source code

ghostTable.samples : Map

Samples prepared for calculations.

Default: {null}

settings

Source code

ghostTable.settings : object

Ghost table settings.

Default: {Object}

table

Source code

ghostTable.table : unknown

Table element.

Methods

addColumn

Source code

ghostTable.addColumn(column, samples)

Add column.

ParamTypeDescription
columnnumberVisual column index.
samplesMapA map with sampled table values.

addColumnHeadersRow

Source code

ghostTable.addColumnHeadersRow(samples)

Add a row consisting of the column headers.

ParamTypeDescription
samplesMapA map with sampled table values.

addRow

Source code

ghostTable.addRow(row, samples)

Add row.

ParamTypeDescription
rownumberVisual row index.
samplesMapSamples Map object.

addRowHeadersColumn

Source code

ghostTable.addRowHeadersColumn(samples, [headerLevel], [renderer])

Add a column consisting of the row headers of the sampled rows.

The mirror image of GhostTable#addColumnHeadersRow: that one measures how tall the column headers are, this one measures how wide the row headers are. The column is registered under a negative index (-1 for the first header level, -2 for the second, and so on), matching the convention that the row header sits at column -1.

ParamTypeDefaultDescription
samplesMapA map with sampled row header labels, keyed the way SamplesGenerator keys them. Only the row indexes are read - the label itself is rendered by the grid’s own row header renderers.
[headerLevel]number0optional The row header level, counting from the grid’s edge.
[renderer]functionoptional The renderer that fills one header cell of that level. Defaults to the grid’s own first-level row header renderer.

appendColumnHeadersRow

Source code

ghostTable.appendColumnHeadersRow()

Creates DOM elements for headers and appends them to the THEAD element of the table.

clean

Source code

ghostTable.clean()

Remove table from document and reset internal state.

createCol

Source code

ghostTable.createCol(column) ⇒ DocumentFragment

Create table column elements.

ParamTypeDescription
columnnumberVisual column index.

Returns: DocumentFragment - Returns created column table column elements.

createColElement

Source code

ghostTable.createColElement(column, row) ⇒ HTMLElement

Create col element.

ParamTypeDescription
columnnumberVisual column index.
rownumberVisual row index.

createColGroupsCol

Source code

ghostTable.createColGroupsCol(row) ⇒ DocumentFragment

Create colgroup col elements.

ParamTypeDescription
rownumberVisual row index.

createContainer

Source code

ghostTable.createContainer(className) ⇒ object

Create container for tables.

ParamTypeDescription
classNamestringThe CSS classes to add.

createRow

Source code

ghostTable.createRow(row) ⇒ DocumentFragment

Create table row element.

ParamTypeDescription
rownumberVisual row index.

Returns: DocumentFragment - Returns created table row elements.

createRowHeadersCol

Source code

ghostTable.createRowHeadersCol([renderer]) ⇒ DocumentFragment

Create the table rows holding the row headers to measure.

The row header counterpart of GhostTable#createCol, and shaped like it: one <tr> per sampled row, so the column sizes itself to the widest of them.

ParamTypeDescription
[renderer]functionoptional The renderer that fills one header cell. Defaults to the grid’s own first-level row header renderer.

Returns: DocumentFragment - Returns created table row elements.

createTable

Source code

ghostTable.createTable(className) ⇒ object

Create table element.

ParamTypeDescription
classNamestringThe CSS classes to add.

getHeights

Source code

ghostTable.getHeights(callback)

Get calculated heights.

ParamTypeDescription
callbackfunctionCallback which will be fired for each calculated row.

getSetting

Source code

ghostTable.getSetting(name) ⇒ boolean | null

Get a single Ghost Table setting.

ParamTypeDescription
namestringThe setting name to get.

getSettings

Source code

ghostTable.getSettings() ⇒ object | null

Get the Ghost Table settings.

getWidths

Source code

ghostTable.getWidths(callback)

Get calculated widths.

ParamTypeDescription
callbackfunctionCallback which will be fired for each calculated column.

injectTable

Source code

ghostTable.injectTable([parent])

Inject generated table into document.

ParamTypeDefaultDescription
[parent]HTMLElementnulloptional The element to which the ghost table is injected.

isHorizontal

Source code

ghostTable.isHorizontal() ⇒ boolean

Checks if table is raised horizontally (checking columns).

isVertical

Source code

ghostTable.isVertical() ⇒ boolean

Checks if table is raised vertically (checking rows).

removeTable

Source code

ghostTable.removeTable()

Remove table from document.

setSetting

Source code

ghostTable.setSetting(name, value)

Set a single setting of the Ghost Table.

ParamTypeDescription
namestringSetting name.
value*Setting value.

setSettings

Source code

ghostTable.setSettings(settings)

Set the Ghost Table settings to the provided object.

ParamTypeDescription
settingsobjectNew Ghost Table Settings.

Description

Initializes the ghost table utility with a reference to the Handsontable instance used for DOM context.

Members

columns

Source code

ghostTable.columns : Array

Added columns collection.

container

Source code

ghostTable.container : HTMLElement | null

Container element where every table will be injected.

hot

Source code

ghostTable.hot : Core

Handsontable instance.

injected

Source code

ghostTable.injected : boolean

Flag which determine is table was injected to DOM.

rows

Source code

ghostTable.rows : Array

Added rows collection.

samples

Source code

ghostTable.samples : Map

Samples prepared for calculations.

Default: {null}

settings

Source code

ghostTable.settings : object

Ghost table settings.

Default: {Object}

table

Source code

ghostTable.table : unknown

Table element.

Methods

addColumn

Source code

ghostTable.addColumn(column, samples)

Add column.

ParamTypeDescription
columnnumberVisual column index.
samplesMapA map with sampled table values.

addColumnHeadersRow

Source code

ghostTable.addColumnHeadersRow(samples)

Add a row consisting of the column headers.

ParamTypeDescription
samplesMapA map with sampled table values.

addRow

Source code

ghostTable.addRow(row, samples)

Add row.

ParamTypeDescription
rownumberVisual row index.
samplesMapSamples Map object.

addRowHeadersColumn

Source code

ghostTable.addRowHeadersColumn(samples, [headerLevel], [renderer])

Add a column consisting of the row headers of the sampled rows.

The mirror image of GhostTable#addColumnHeadersRow: that one measures how tall the column headers are, this one measures how wide the row headers are. The column is registered under a negative index (-1 for the first header level, -2 for the second, and so on), matching the convention that the row header sits at column -1.

ParamTypeDefaultDescription
samplesMapA map with sampled row header labels, keyed the way SamplesGenerator keys them. Only the row indexes are read - the label itself is rendered by the grid’s own row header renderers.
[headerLevel]number0optional The row header level, counting from the grid’s edge.
[renderer]functionoptional The renderer that fills one header cell of that level. Defaults to the grid’s own first-level row header renderer.

appendColumnHeadersRow

Source code

ghostTable.appendColumnHeadersRow()

Creates DOM elements for headers and appends them to the THEAD element of the table.

clean

Source code

ghostTable.clean()

Remove table from document and reset internal state.

createCol

Source code

ghostTable.createCol(column) ⇒ DocumentFragment

Create table column elements.

ParamTypeDescription
columnnumberVisual column index.

Returns: DocumentFragment - Returns created column table column elements.

createColElement

Source code

ghostTable.createColElement(column, row) ⇒ HTMLElement

Create col element.

ParamTypeDescription
columnnumberVisual column index.
rownumberVisual row index.

createColGroupsCol

Source code

ghostTable.createColGroupsCol(row) ⇒ DocumentFragment

Create colgroup col elements.

ParamTypeDescription
rownumberVisual row index.

createContainer

Source code

ghostTable.createContainer(className) ⇒ object

Create container for tables.

ParamTypeDescription
classNamestringThe CSS classes to add.

createRow

Source code

ghostTable.createRow(row) ⇒ DocumentFragment

Create table row element.

ParamTypeDescription
rownumberVisual row index.

Returns: DocumentFragment - Returns created table row elements.

createRowHeadersCol

Source code

ghostTable.createRowHeadersCol([renderer]) ⇒ DocumentFragment

Create the table rows holding the row headers to measure.

The row header counterpart of GhostTable#createCol, and shaped like it: one <tr> per sampled row, so the column sizes itself to the widest of them.

ParamTypeDescription
[renderer]functionoptional The renderer that fills one header cell. Defaults to the grid’s own first-level row header renderer.

Returns: DocumentFragment - Returns created table row elements.

createTable

Source code

ghostTable.createTable(className) ⇒ object

Create table element.

ParamTypeDescription
classNamestringThe CSS classes to add.

getHeights

Source code

ghostTable.getHeights(callback)

Get calculated heights.

ParamTypeDescription
callbackfunctionCallback which will be fired for each calculated row.

getSetting

Source code

ghostTable.getSetting(name) ⇒ boolean | null

Get a single Ghost Table setting.

ParamTypeDescription
namestringThe setting name to get.

getSettings

Source code

ghostTable.getSettings() ⇒ object | null

Get the Ghost Table settings.

getWidths

Source code

ghostTable.getWidths(callback)

Get calculated widths.

ParamTypeDescription
callbackfunctionCallback which will be fired for each calculated column.

injectTable

Source code

ghostTable.injectTable([parent])

Inject generated table into document.

ParamTypeDefaultDescription
[parent]HTMLElementnulloptional The element to which the ghost table is injected.

isHorizontal

Source code

ghostTable.isHorizontal() ⇒ boolean

Checks if table is raised horizontally (checking columns).

isVertical

Source code

ghostTable.isVertical() ⇒ boolean

Checks if table is raised vertically (checking rows).

removeTable

Source code

ghostTable.removeTable()

Remove table from document.

setSetting

Source code

ghostTable.setSetting(name, value)

Set a single setting of the Ghost Table.

ParamTypeDescription
namestringSetting name.
value*Setting value.

setSettings

Source code

ghostTable.setSettings(settings)

Set the Ghost Table settings to the provided object.

ParamTypeDescription
settingsobjectNew Ghost Table Settings.