Skip to content

CollapsibleColumns

Options

collapsibleColumns

Source code

collapsibleColumns.collapsibleColumns : boolean | Array<object>

The collapsibleColumns option configures the CollapsibleColumns plugin.

You can set the collapsibleColumns option to one of the following:

SettingDescription
falseDisable the CollapsibleColumns plugin
trueEnable the CollapsibleColumns plugin
An array of objectsEnable the CollapsibleColumns plugin for selected column headers

When using an array of objects, specify the header to make collapsible using row and col. The row value is a negative integer that counts header levels from the bottom of the header area: -1 is the header row closest to the data, -2 is one level above, and so on. This option requires the nestedHeaders plugin to be configured.

This option can only be set at the grid level. It has no effect when set in the columns, cells, or cell options.

Read more:

Default: undefined
Example

// enable column collapsing for all headers
collapsibleColumns: true,
// enable column collapsing for selected headers
collapsibleColumns: [
{row: -4, col: 1, collapsible: true},
{row: -3, col: 5, collapsible: true}
],

Members

PLUGIN_DEPS

Source code

CollapsibleColumns.PLUGIN_DEPS

Returns the list of plugin dependencies required before this plugin can be initialized.

PLUGIN_KEY

Source code

CollapsibleColumns.PLUGIN_KEY

Returns the plugin key used to identify this plugin in Handsontable settings.

PLUGIN_PRIORITY

Source code

CollapsibleColumns.PLUGIN_PRIORITY

Returns the priority order used to determine the order in which plugins are initialized.

SETTING_KEYS

Source code

CollapsibleColumns.SETTING_KEYS

Returns the setting keys that trigger a plugin update when changed via updateSettings.

Methods

collapseAll

Source code

collapsibleColumns.collapseAll()

Collapses all collapsible sections.

collapseSection

Source code

collapsibleColumns.collapseSection(coords)

Collapses section at the provided coords. coords.col may be any column the group’s header spans, not only its first (anchor) column - it resolves to the owning collapsible group.

ParamTypeDescription
coordsobjectContains coordinates information. (coords.row, coords.col).

destroy

Source code

collapsibleColumns.destroy()

Destroys the plugin instance.

disablePlugin

Source code

collapsibleColumns.disablePlugin()

Disables the plugin functionality for this Handsontable instance.

enablePlugin

Source code

collapsibleColumns.enablePlugin()

Enables the plugin functionality for this Handsontable instance.

expandAll

Source code

collapsibleColumns.expandAll()

Expands all collapsible sections.

expandSection

Source code

collapsibleColumns.expandSection(coords)

Expands section at the provided coords. coords.col may be any column the group’s header spans, not only its first (anchor) column - it resolves to the owning collapsible group.

ParamTypeDescription
coordsobjectContains coordinates information. (coords.row, coords.col).

isEnabled

Source code

collapsibleColumns.isEnabled() ⇒ boolean

Checks if the plugin is enabled in the handsontable settings. This method is executed in Hooks#beforeInit hook and if it returns true then the CollapsibleColumns#enablePlugin method is called.

toggleAllCollapsibleSections

Source code

collapsibleColumns.toggleAllCollapsibleSections(action)

Collapses or expand all collapsible sections, depending on the action parameter.

ParamTypeDescription
actionstring’collapse’ or ‘expand’.

toggleCollapsibleSection

Source code

collapsibleColumns.toggleCollapsibleSection(coords, [action])

Collapses/Expands a section.

Emits: Hooks#event:beforeColumnCollapse, Hooks#event:beforeColumnExpand, Hooks#event:afterColumnCollapse, Hooks#event:afterColumnExpand

ParamTypeDescription
coordsArrayArray of coords - section coordinates.
[action]stringoptional Action definition (‘collapse’ or ‘expand’).

updatePlugin

Source code

collapsibleColumns.updatePlugin()

Updates the plugin’s state.

This method is executed when updateSettings() is invoked with any of the following configuration options: