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 optional

Options added to the grid

resize : boolean | string | Array optional

Enable resizing rows and columns. Pass "columns" or "rows" (or an array) to enable just one axis; false to disable.

resizeMin : number optional

minimum size (px) an axis element can be dragged to

Events

Fired after a column resize finishes (on pointerup).

Properties

column : DataGridColumn

the resized column

width : number

the new width in px

Fired after a row resize finishes (on pointerup).

Properties

row : DataGridRow

the resized row

height : number

the new height in px