FreezeBar
See the Column freezing guide for examples and configuration details.
Options
freezeBar
Can be set at: grid
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:
| Setting | Description |
|---|---|
true | Enable the FreezeBar plugin for rows and columns |
false | Disable the FreezeBar plugin |
| An object | Enable the FreezeBar plugin and choose the axes |
The object form accepts the following properties:
| Property | Type | Default | Description |
|---|---|---|---|
rows | boolean | true | Show the bar for frozen rows |
columns | boolean | true | Show 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` pluginfreezeBar: true,
// enable the `FreezeBar` plugin for columns onlyfreezeBar: { rows: false,},Members
LICENSE
FreezeBar.LICENSE
Returns the license token of the plugin, its display name, where it is checked, and the tokens it requires.
PLUGIN_KEY
FreezeBar.PLUGIN_KEY ⇒ string
The key of the plugin, which is also the name of its option.
PLUGIN_PRIORITY
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
freezeBar.destroy()
Destroys the plugin instance.
disablePlugin
freezeBar.disablePlugin()
Disables the plugin functionality for this Handsontable instance.
enablePlugin
freezeBar.enablePlugin()
Enables the plugin functionality for this Handsontable instance.
getFreezeCount
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.
| Param | Type | Description |
|---|---|---|
| edge | string | The edge: top, bottom, start or end. |
isEnabled
freezeBar.isEnabled() ⇒ boolean
Checks if the plugin is enabled in the settings.
setFreezeCount
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.
| Param | Type | Description |
|---|---|---|
| edge | string | The edge: top, bottom, start or end. |
| count | number | The new count. |
Returns: boolean - true when the count changed.
updatePlugin
freezeBar.updatePlugin()
Updates the plugin’s state. This method is executed when Core#updateSettings is invoked.