CustomBorders
Methods
clearBorders
customBorders.clearBorders(selectionRanges)
Clear custom borders.
Example
const customBordersPlugin = hot.getPlugin('customBorders');
// Using an array of arrays (produced by `.getSelected()` method).customBordersPlugin.clearBorders([[1, 1, 2, 2], [6, 2, 0, 2]]);// Using an array of CellRange objects (produced by `.getSelectedRange()` method).customBordersPlugin.clearBorders(hot.getSelectedRange());// Using without param - clear all customBorders.customBordersPlugin.clearBorders();| Param | Type | Description |
|---|---|---|
| selectionRanges | Array<Array> Array<CellRange> | Array of selection ranges. |
destroy
customBorders.destroy()
Destroys the plugin instance.
disablePlugin
customBorders.disablePlugin()
Disables the plugin functionality for this Handsontable instance.
enablePlugin
customBorders.enablePlugin()
Enables the plugin functionality for this Handsontable instance.
getBorders
customBorders.getBorders(selectionRanges) ⇒ Array<object>
Get custom borders.
Example
const customBordersPlugin = hot.getPlugin('customBorders');
// Using an array of arrays (produced by `.getSelected()` method).customBordersPlugin.getBorders([[1, 1, 2, 2], [6, 2, 0, 2]]);// Using an array of CellRange objects (produced by `.getSelectedRange()` method).customBordersPlugin.getBorders(hot.getSelectedRange());// Using without param - return all customBorders.customBordersPlugin.getBorders();| Param | Type | Description |
|---|---|---|
| selectionRanges | Array<Array> Array<CellRange> | Array of selection ranges. |
Returns: Array<object> - Returns array of border objects.
isEnabled
customBorders.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 CustomBorders#enablePlugin method is called.
setBorders
customBorders.setBorders(selectionRanges, borderObject)
Set custom borders.
Example
const customBordersPlugin = hot.getPlugin('customBorders');
// Using an array of arrays (produced by `.getSelected()` method).customBordersPlugin.setBorders([[1, 1, 2, 2], [6, 2, 0, 2]], {start: {width: 2, color: 'blue'}});
// Using an array of CellRange objects (produced by `.getSelectedRange()` method).// Selecting a cell range.hot.selectCell(0, 0, 2, 2);// Returning selected cells' range with the getSelectedRange method.customBordersPlugin.setBorders(hot.getSelectedRange(), {start: {hide: false, width: 2, color: 'blue'}});| Param | Type | Description |
|---|---|---|
| selectionRanges | Array<Array> Array<CellRange> | Array of selection ranges. |
| borderObject | object | Object with top, right, bottom and start properties. |
updatePlugin
customBorders.updatePlugin()
Updates the plugin’s state.
This method is executed when updateSettings() is invoked with any of the following configuration options: