Skip to content

Migrating from v1 to v2

This guide covers every breaking change in @toolbox-web/grid v2 and its Angular, React, and Vue adapters. Most changes are simple renames that can be done with find-and-replace. A handful require manual migration due to structural API changes.

v2 removes ~106 deprecated items across the grid core and all three framework adapters. The majority are renames — removing framework prefixes from types (e.g., ReactGridConfigGridConfig), renaming features for clarity (e.g., sortingmultiSort), and replacing sticky with pinned. A few structural API changes (like useGridEvent() removal) require manual attention.

~75 of ~106 changes are simple 1:1 renames. Use your IDE’s find-and-replace (Ctrl+Shift+H) or the sed commands below.

v1 (removed)v2 (replacement)KindDeprecated since
ActivateCellDetailCellActivateDetailTypev1.0.0
activate-cellcell-activateEventv1.0.0
StickyPositionPinnedPositionTypev1.15.0
ResolvedStickyPositionResolvedPinnedPositionTypev1.15.0
EditorContextColumnEditorContextTypev1.12.0
RowGroupingConfigGroupingRowsConfigTypev1.24.0
RowGroupingStateGroupingRowsStateTypev1.24.0
PLUGIN_QUERIESString literals with grid.query()Constantv1.8.0

Grid Core — Property & Attribute Renames

Section titled “Grid Core — Property & Attribute Renames”
v1 (removed)v2 (replacement)KindDeprecated since
.sticky.pinnedColumn config propertyv1.15.0
'sticky''pinned'String keyv1.15.0
sticky:pinned:Config keyv1.15.0
sizableresizableHTML attributev1.0.0

The server-side plugin’s datasource interface was renamed from row-centric to node-centric terminology (a “node” is the atomic pagination unit — a row for flat data, a top-level tree/group node for hierarchical data).

v1 (removed)v2 (replacement)KindDeprecated since
GetRowsParams.startRowGetRowsParams.startNodeInterface propertyv1.24.0
GetRowsParams.endRowGetRowsParams.endNodeInterface propertyv1.24.0
GetRowsResult.totalRowCountGetRowsResult.totalNodeCountInterface propertyv1.24.0
GetRowsResult.lastRowGetRowsResult.lastNodeInterface propertyv1.24.0
plugin.getTotalRowCount()plugin.getTotalNodeCount()Methodv1.24.0
plugin.isRowLoaded(index)plugin.isNodeLoaded(index)Methodv1.24.0
v1 (removed)v2 (replacement)KindDeprecated since
'sorting''multiSort'Feature namev1.24.0
sorting:multiSort:Config keyv1.24.0
'reorder''reorderColumns'Feature namev1.24.0
reorder:reorderColumns:Config keyv1.24.0
rowReorderreorderRowsFeature namev1.24.0

Grid Core — Function Renames (Plugin Authors)

Section titled “Grid Core — Function Renames (Plugin Authors)”
v1 (removed)v2 (replacement)KindDeprecated since
onPluginQueryhandleQueryPlugin hookv1.8.0
getPivotAggregatorgetValueAggregatorFunctionv1.24.0
createPinnedRowsElementcreateInfoBarElementFunctionv1.24.0
v1 (removed)v2 (replacement)KindDeprecated since
AngularGridAdapterGridAdapterType / export0.11.0
AngularCellRendererCellRendererType0.11.0
AngularCellEditorCellEditorType0.11.0
AngularColumnConfigColumnConfigType0.11.0
AngularGridConfigGridConfigType0.11.0
AngularTypeDefaultTypeDefaultType0.11.0
[angularConfig][gridConfig]Directive input0.11.0
[sorting][multiSort]Directive input0.11.0
[reorder][reorderColumns]Directive input0.11.0
[rowReorder][reorderRows]Directive input0.11.0
TbwCellEditorTbwEditorStructural directive0.11.0
TbwCellViewTbwRendererStructural directive0.11.0

Feature import paths:

v1 pathv2 path
@toolbox-web/grid-angular/features/sorting@toolbox-web/grid-angular/features/multi-sort
@toolbox-web/grid-angular/features/reorder@toolbox-web/grid-angular/features/reorder-columns
@toolbox-web/grid-angular/features/row-reorder@toolbox-web/grid-angular/features/reorder-rows
v1 (removed)v2 (replacement)KindDeprecated since
ReactGridAdapterGridAdapterType / export0.11.0
ReactColumnConfigColumnConfigType0.11.0
ReactGridConfigGridConfigType0.11.0
ReactTypeDefaultTypeDefaultType0.11.0
reactTypeDefaultToGridTypeDefaulttypeDefaultToBaseTypeDefaultFunction0.11.0
processReactGridConfigprocessGridConfigFunction0.11.0
sorting propmultiSort propComponent prop0.11.0
reorder propreorderColumns propComponent prop0.11.0
rowReorder propreorderRows propComponent prop0.11.0

Feature import paths:

v1 pathv2 path
@toolbox-web/grid-react/features/sorting@toolbox-web/grid-react/features/multi-sort
@toolbox-web/grid-react/features/reorder@toolbox-web/grid-react/features/reorder-columns
@toolbox-web/grid-react/features/row-reorder@toolbox-web/grid-react/features/reorder-rows
v1 (removed)v2 (replacement)KindDeprecated since
VueGridAdapterGridAdapterType / export0.11.0
VueCellRendererCellRendererType0.11.0
VueCellEditorCellEditorType0.11.0
VueColumnConfigColumnConfigType0.11.0
VueGridConfigGridConfigType0.11.0
VueTypeDefaultTypeDefaultType0.11.0
sorting propmultiSort propComponent prop0.11.0
reorder propreorderColumns propComponent prop0.11.0
rowReorder propreorderRows propComponent prop0.11.0

Feature import paths:

v1 pathv2 path
@toolbox-web/grid-vue/features/reorder@toolbox-web/grid-vue/features/reorder-columns
@toolbox-web/grid-vue/features/row-reorder@toolbox-web/grid-vue/features/reorder-rows
// v1
import styles from '@toolbox-web/grid/styles';
// v2
import { gridStyles } from '@toolbox-web/grid/styles';

These structural API changes cannot be safely automated with find-and-replace. Each requires understanding the surrounding code.

queryPlugins()query() — Parameter format change

Section titled “queryPlugins() → query() — Parameter format change”

Deprecated since v1.8.0. The object-based parameter was replaced with a flat signature.

const results = grid.queryPlugins<boolean>({
type: 'canMoveColumn',
context: column,
});

Deprecated since v1.21.0. This method was already a no-op in late v1. Delete all calls to suspendProcessing() and resumeProcessing(). Use insertRow() / removeRow() for individual row mutations — batching is handled internally.

grid.suspendProcessing();
// ... batch operations ...
grid.resumeProcessing();

getExtraHeight() / getExtraHeightBefore()getRowHeight()

Section titled “getExtraHeight() / getExtraHeightBefore() → getRowHeight()”

Plugin authors only. Deprecated since v1.12.0. The two aggregate height hooks were replaced by a single per-row hook.

getExtraHeight(): number {
return this.expandedRows.size * this.detailHeight;
}
getExtraHeightBefore(beforeRowIndex: number): number {
let height = 0;
for (const idx of this.expandedRowIndices) {
if (idx < beforeRowIndex) height += this.detailHeight;
}
return height;
}

Plugin authors only. Deprecated since v1.31.0. The return-value pattern was replaced with a DOM-mutation pattern.

const icon = this.resolveIcon('sort-asc');
element.innerHTML = typeof icon === 'string' ? icon : '';

PLUGIN_QUERIES constant → String literals

Section titled “PLUGIN_QUERIES constant → String literals”

Plugin authors only. Deprecated since v1.8.0. The constant object was removed. Use string literals with grid.query() instead.

import { PLUGIN_QUERIES } from '@toolbox-web/grid';
grid.queryPlugins({
type: PLUGIN_QUERIES.CAN_MOVE_COLUMN,
context: column,
});

Angular: commit/cancel outputs → onCommit/onCancel callbacks

Section titled “Angular: commit/cancel outputs → onCommit/onCancel callbacks”

Deprecated since grid-angular 0.11.0. The EventEmitter-based outputs on the editor directive were replaced with simple callback functions on the editor context.

// In your editor component
@Output() commit = new EventEmitter<string>();
@Output() cancel = new EventEmitter<void>();
save() {
this.commit.emit(this.value);
}

React: useGridEvent() → Event props on <DataGrid>

Section titled “React: useGridEvent() → Event props on <DataGrid>”

Deprecated since grid-react 0.18.0. The useGridEvent hook was removed. Use event handler props directly on the <DataGrid> component.

import { useGridEvent } from '@toolbox-web/grid-react';
function MyGrid() {
const gridRef = useRef(null);
useGridEvent(gridRef, 'selection-change', (e) => {
setSelected(e.detail);
});
return <DataGrid ref={gridRef} />;
}

Vue: useGridEvent() → Template event handlers

Section titled “Vue: useGridEvent() → Template event handlers”

Deprecated since grid-vue 0.11.0. The useGridEvent composable was removed. Use standard Vue template event handlers on <TbwGrid>.

<script setup>
import { useGridEvent } from '@toolbox-web/grid-vue';
useGridEvent('selection-change', (e) => {
selected.value = e.detail;
});
</script>
<template>
<TbwGrid />
</template>

All Adapters: SelectionMethods/ExportMethods → Feature-specific functions

Section titled “All Adapters: SelectionMethods/ExportMethods → Feature-specific functions”

Deprecated since adapter 0.11.0. The monolithic injectGrid() / useGrid() return type no longer includes selection and export methods. Import them from their respective feature modules instead.

// v1
const { selectAll, clearSelection, exportToCsv } = injectGrid();
// v2
import { injectGridSelection } from '@toolbox-web/grid-angular/features/selection';
import { injectGridExport } from '@toolbox-web/grid-angular/features/export';
const { selectAll, clearSelection } = injectGridSelection();
const { exportToCsv } = injectGridExport();

Yes, as long as they use handleQuery() (not onPluginQuery()). If your plugin implements onPluginQuery, rename it to handleQuery — the signature is identical.

Do I need to update adapter packages at the same time?

Section titled “Do I need to update adapter packages at the same time?”

Yes. The v2 adapter packages (@toolbox-web/grid-angular, @toolbox-web/grid-react, @toolbox-web/grid-vue) require @toolbox-web/grid v2 as a peer dependency. Update all packages together.

The default export from the styles module was removed. Use the named export instead:

// v1
import styles from '@toolbox-web/grid/styles';
// v2
import { gridStyles } from '@toolbox-web/grid/styles';

The suspendProcessing() method was already a no-op in late v1 — removing it has no runtime impact. All other changes are API surface renames. If your v1 code compiled without deprecation warnings, the migration is purely mechanical.

AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt