Skip to content

FreezeBar

See the Column freezing guide for examples and configuration details.

Options

freezeBar

Can be set at: grid

Source code

freezeBar.freezeBar : boolean | object

The freezeBar option configures the FreezeBar plugin.

The plugin draws a bar on each edge of the frozen area. You drag the bar, or focus it and press the arrow keys, to change how many rows or columns are frozen. An edge with nothing frozen has a short handle on a corner of the headers, so users can start freezing from there.

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

SettingDescription
trueEnable the FreezeBar plugin for rows and columns
falseDisable the FreezeBar plugin
An objectEnable the FreezeBar plugin and choose the axes

The object form accepts the following properties:

PropertyTypeDefaultDescription
rowsbooleantrueShow the bar for frozen rows
columnsbooleantrueShow the bar for frozen columns

The plugin changes the frozen counts on the grid only. It does not write them back to the settings you passed in, so an application that keeps the counts in its own state copies them in the afterFreezeChange hook.

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

Default: undefined
Since: 19.0.0
Example

// enable the `FreezeBar` plugin
freezeBar: true,
// enable the `FreezeBar` plugin for columns only
freezeBar: {
rows: false,
},

Members

LICENSE

Source code

FreezeBar.LICENSE

Returns the license token of the plugin, its display name, where it is checked, and the tokens it requires.

PLUGIN_KEY

Source code

FreezeBar.PLUGIN_KEY ⇒ string

The key of the plugin, which is also the name of its option.

PLUGIN_PRIORITY

Source code

FreezeBar.PLUGIN_PRIORITY ⇒ number

The enable order of the plugin. It enables after the plugins that hide or trim the tracks it measures.

Methods

destroy

Source code

freezeBar.destroy()

Destroys the plugin instance.

disablePlugin

Source code

freezeBar.disablePlugin()

Disables the plugin functionality for this Handsontable instance.

enablePlugin

Source code

freezeBar.enablePlugin()

Enables the plugin functionality for this Handsontable instance.

getFreezeCount

Source code

freezeBar.getFreezeCount(edge) ⇒ number

Gets the number of frozen rows or columns on the given edge, as configured. It is the count an app saves and the count the hooks report. The start band has priority over the end band, so the end band is the part of it that remains. With limitFixedToViewport the grid may draw fewer tracks than this: the bar and its ARIA value follow the drawn count, and there is no public method that returns it.

ParamTypeDescription
edgestringThe edge: top, bottom, start or end.

isEnabled

Source code

freezeBar.isEnabled() ⇒ boolean

Checks if the plugin is enabled in the settings.

setFreezeCount

Source code

freezeBar.setFreezeCount(edge, count) ⇒ boolean

Sets the number of frozen rows or columns on the given edge. A count that grows is cut down to what fits the viewport; a count that stays or shrinks is taken as it is, even when more than that no longer fits. The change can be canceled in the Hooks#beforeFreezeChange hook.

ParamTypeDescription
edgestringThe edge: top, bottom, start or end.
countnumberThe new count.

Returns: boolean - true when the count changed.

updatePlugin

Source code

freezeBar.updatePlugin()

Updates the plugin’s state. This method is executed when Core#updateSettings is invoked.