ManualColumnResize
Description
Initializes the plugin and applies CSS classes to the resize handle and guide elements.
Options
manualColumnResize
manualColumnResize.manualColumnResize : boolean | Array<number>
The manualColumnResize option configures the ManualColumnResize plugin.
You can set the manualColumnResize option to one of the following:
| Setting | Description |
|---|---|
true | Enable the ManualColumnResize plugin |
false | Disable the ManualColumnResize plugin |
| An array | - Enable the ManualColumnResize plugin- Set initial widths of individual columns |
Read more:
When you set initial widths through the array form, those columns are excluded from
stretchH redistribution. Only the columns without a pre-defined width are stretched.
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
Example
// enable the `manualColumnResize` pluginmanualColumnResize: true,
// enable the `manualColumnResize` plugin// set the initial width of column 0 to 40 pixels// set the initial width of column 1 to 50 pixels// set the initial width of column 2 to 60 pixelsmanualColumnResize: [40, 50, 60],Members
PLUGIN_KEY
ManualColumnResize.PLUGIN_KEY
Returns the plugin key used to identify this plugin in Handsontable settings.
PLUGIN_PRIORITY
ManualColumnResize.PLUGIN_PRIORITY
Returns the priority order used to determine the order in which plugins are initialized.
Methods
clearManualSize
manualColumnResize.clearManualSize(column)
Clears the cache for the specified column index.
| Param | Type | Description |
|---|---|---|
| column | number | Visual column index. |
destroy
manualColumnResize.destroy()
Destroys the plugin instance.
disablePlugin
manualColumnResize.disablePlugin()
Disables the plugin functionality for this Handsontable instance.
enablePlugin
manualColumnResize.enablePlugin()
Enables the plugin functionality for this Handsontable instance.
isEnabled
manualColumnResize.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 ManualColumnResize#enablePlugin method is called.
loadManualColumnWidths Deprecated
manualColumnResize.loadManualColumnWidths() ⇒ Array
Deprecated. The `PersistentState` plugin has been removed. This method is a no-op and will be removed in a future major release.saveManualColumnWidths Deprecated
manualColumnResize.saveManualColumnWidths()
Deprecated. The `PersistentState` plugin has been removed. This method is a no-op and will be removed in a future major release.setManualSize
manualColumnResize.setManualSize(column, width) ⇒ number
Sets the new width for the specified visual column index.
This method updates the plugin’s internal width map. Call render() after setManualSize() to repaint the grid.
Values lower than 20px are saved as 20px.
Example
const resizePlugin = hot.getPlugin('manualColumnResize');
resizePlugin.setManualSize(0, 120);hot.render();| Param | Type | Description |
|---|---|---|
| column | number | Visual column index. |
| width | number | Column width (no less than 20px). |
Returns: number - Returns new width.
updatePlugin
manualColumnResize.updatePlugin()
Updates the plugin’s state.
This method is executed when updateSettings() is invoked with any of the following configuration options: