ResizeController
Since v0.1.1
Controller managing drag-based column resize lifecycle.
Exposed internally for plugins that need to interact with resize behavior.
Example
Section titled “Example”import type { ResizeController, InternalGrid } from '@toolbox-web/grid';
class MyPlugin extends BaseGridPlugin { handleColumnAction(colIndex: number): void { const grid = this.grid as InternalGrid; const resizeCtrl = grid._resizeController;
// Check if resize is in progress if (resizeCtrl?.isResizing) { return; // Don't interfere }
// Reset column to configured width resizeCtrl?.resetColumn(colIndex); }}Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
start | (e: MouseEvent | PointerEvent, colIndex: number, cell: HTMLElement, captureTarget: Element) => void | Begin a column resize drag. |
resetColumn | (colIndex: number) => void | Reset a column to its configured width (or auto-size if none configured). |
setColumnWidth | (colIndex: number, width: number) => void | Set a column’s width directly, without a drag gesture. v3.6.0+ |
getColumnWidth | (colIndex: number) => number | Current rendered width of a column in px. v3.6.0+ |
dispose | () => void | |
isResizing | boolean | True while a resize drag is in progress (used to suppress header click/sort). |
Property Details
Section titled “Property Details”setColumnWidth
Section titled “setColumnWidth”Set a column’s width directly, without a drag gesture.
Clamps to the column’s minWidth (or 40px), commits the same state the
drag path commits, and emits column-resize. This is the primitive behind
the click-only width control required by WCAG 2.2 SC 2.5.7.
See Also
Section titled “See Also”ColumnResizeDetailfor resize event details