Class: NestedHeaders

NestedHeaders

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

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 179

checkForFixedColumnsCollision()

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

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

checkForOverlappingHeaders()

Check if the configuration contains overlapping headers.

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

destroy()

Destroy the plugin.

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

disablePlugin()

Disable the plugin.

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

enablePlugin()

Enable the plugin.

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

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 331

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 364

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 278

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 81

isEnabled(){Boolean}

Check if plugin is enabled

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

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 353

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 223

setupColspanArray()

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

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

updatePlugin()

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