Plugin/DataGridResizable
A plugin to make a DataGrid (and its subclasses, e.g. Spreadsheet) resizable along columns and/or rows.
Example
JS
import Spreadsheet from 'komps/komps/spreadsheet.js'
import { resizable } from 'komps/komps/data-grid/plugins.js'
Spreadsheet.include(resizable)
new Spreadsheet({
resize: ['columns'], // columns only; omit for both
data: [...],
columns: [
{ header: 'Name', width: 200 },
{ header: 'Locked', width: 80, resize: false } // opt a column out
]
})Parameters
options
:
Object
optionalOptions added to the grid
resize
:
boolean
|
string
|
Array
optionalEnable resizing rows and columns. Pass "columns" or "rows" (or an array) to enable just one axis; false to disable.
resizeMin
:
number
optionalminimum size (px) an axis element can be dragged to
Events
Fired after a column resize finishes (on pointerup).
Properties
width
:
number
the new width in px
Fired after a row resize finishes (on pointerup).
Properties
height
:
number
the new height in px