Class: NestedHeaders

NestedHeaders

handsontable-pro/src/plugins/nestedHeaders/nestedHeaders.js, line 46

This plugin allows to create a nested header structure, using the HTML's colspan attribute.

To make any header wider (covering multiple table columns), it's corresponding configuration array element should be provided as an object with label and colspan properties.
The label property defines the header's label, while the colspan property defines a number of columns that the header should cover.

Note that the plugin supports a nested structure, which means, any header cannot be wider than it's "parent". In
other words, headers cannot overlap each other.

Example
...
let hot = new Handsontable(document.getElementById('example'), {
  date: getData(),
 nestedHeaders: [
          ['A', {label: 'B', colspan: 8}, 'C'],
          ['D', {label: 'E', colspan: 4}, {label: 'F', colspan: 4}, 'G'],
          ['H', {label: 'I', colspan: 2}, {label: 'J', colspan: 2}, {label: 'K', colspan: 2}, {label: 'L', colspan: 2}, 'M'],
          ['N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W']
 ],
...

Members

colspanArrayArray

Array of nested headers' colspans.

columnHeaderLevelCountNumber

Cached number of column header levels.

ghostTableGhostTable

Custom helper for getting widths of the nested headers.

TODO
  • This should be changed after refactor handsontable/utils/ghostTable.

settingsObject

Nasted headers cached settings.

Methods

handsontable-pro/src/plugins/nestedHeaders/nestedHeaders.js, line 180

checkForFixedColumnsCollision()

Check if the nested headers overlap the fixed columns overlay, if so - display a warning.

handsontable-pro/src/plugins/nestedHeaders/nestedHeaders.js, line 194

checkForOverlappingHeaders()

Check if the configuration contains overlapping headers.

handsontable-pro/src/plugins/nestedHeaders/nestedHeaders.js, line 654

destroy()

Destroy the plugin.

handsontable-pro/src/plugins/nestedHeaders/nestedHeaders.js, line 114

disablePlugin()

Disable the plugin.

handsontable-pro/src/plugins/nestedHeaders/nestedHeaders.js, line 89

enablePlugin()

Enable the plugin.

handsontable-pro/src/plugins/nestedHeaders/nestedHeaders.js, line 263

fillColspanArrayWithDummies(colspan, level)

Fill the "colspan array" with default data for the dummy hidden headers.

Parameters:
Name Type Description
colspan Number

The colspan value.

level Number

Header level.

handsontable-pro/src/plugins/nestedHeaders/nestedHeaders.js, line 425

fillTheRemainingColspans()

Fill the remaining colspanArray entries for the undeclared column headers.

handsontable-pro/src/plugins/nestedHeaders/nestedHeaders.js, line 398

getChildHeaders(row, column, colspan){Array}

Returns (physical) indexes of headers below the header with provided coordinates.

Parameters:
Name Type Description
row Number

Row index.

column Number

Column index.

colspan Number

Colspan value.

Returns: {Array}
handsontable-pro/src/plugins/nestedHeaders/nestedHeaders.js, line 332

getColspan(row, column){Number}

Get the colspan for the provided coordinates.

Parameters:
Name Type Description
row Number

Row index.

column Number

Column index.

Returns: {Number}
handsontable-pro/src/plugins/nestedHeaders/nestedHeaders.js, line 365

getNestedParent(level, column){*}

Get the column index of the "parent" nested header.

Parameters:
Name Type Description
level Number

Header level.

column Number

Column index.

Returns: {*}
handsontable-pro/src/plugins/nestedHeaders/nestedHeaders.js, line 279

headerRendererFactory(headerRow){function}

Generates the appropriate header renederer for a header row.

Parameters:
Name Type Description
headerRow Number

The header row.

Returns: {function}
handsontable-pro/src/plugins/nestedHeaders/nestedHeaders.js, line 82

isEnabled(){Boolean}

Check if plugin is enabled

Returns: {Boolean}
handsontable-pro/src/plugins/nestedHeaders/nestedHeaders.js, line 344

levelToRowCoords(level){Number}

Translate the level value (header row index from the top) to the row value (negative index).

Parameters:
Name Type Description
level Number

Header level.

Returns: {Number}
handsontable-pro/src/plugins/nestedHeaders/nestedHeaders.js, line 354

rowCoordsToLevel(row){Number}

Translate the row value (negative index) to the level value (header row index from the top).

Parameters:
Name Type Description
row Number

Row index.

Returns: {Number}
handsontable-pro/src/plugins/nestedHeaders/nestedHeaders.js, line 224

setupColspanArray()

Create an internal array containing information of the headers with a colspan attribute.

handsontable-pro/src/plugins/nestedHeaders/nestedHeaders.js, line 129

updatePlugin()

Updates the plugin to use the latest options you have specified.