Skip to content

Row Expand Plugin

The RowExpandPlugin adds inline expandable detail rows to RevoGrid. It is useful when a row needs a compact secondary area for a form, nested grid, notes, preview content, or any row-local custom template.

Unlike the Master Rows feature, RowExpandPlugin does not render a master-detail overlay. It inserts an expanded row into the regular row viewport and renders your rowExpand.template inside that row.

Import the plugin and add it to the grid:

import { RowExpandPlugin } from '@revolist/revogrid-pro';
const grid = document.createElement('revo-grid');
grid.plugins = [RowExpandPlugin];

Add expand: true to the column that should render the expand toggle:

grid.columns = [
{ prop: 'name', name: 'Name', expand: true },
{ prop: 'status', name: 'Status' },
];

Configure expanded row behavior with grid.rowExpand:

grid.rowExpand = {
expandedRows: new Set([0]),
expandedRowHeight: 220,
template: (h, props) =>
h('div', { class: 'row-detail' }, [
h('strong', null, props.model.name),
h('p', null, props.model.description),
]),
};
OptionTypeDescription
expandedRowsSet<number>Physical row indexes that should be expanded by default.
expandedRowHeightnumberHeight, in pixels, for each expanded detail row.
hideExpandboolean | ((rowIndex: number, model: any) => boolean)Hides the expand toggle for all rows or for specific rows. Return true to hide the toggle.
template(h: any, props: any) => VNodeRenders the expanded row content. The template receives the row model and render context.

additionalData.rowExpand is still supported for compatibility, but prefer the direct grid.rowExpand property.

The plugin listens for row expansion events:

import {
ROW_COLLAPSE,
ROW_COLLAPSE_ALL,
ROW_EXPAND,
ROW_EXPAND_ALL,
} from '@revolist/revogrid-pro';
grid.dispatchEvent(new CustomEvent(ROW_EXPAND, { detail: { rowIndex: 0 } }));
grid.dispatchEvent(new CustomEvent(ROW_COLLAPSE, { detail: { rowIndex: 0 } }));
grid.dispatchEvent(new CustomEvent(ROW_EXPAND_ALL));
grid.dispatchEvent(new CustomEvent(ROW_COLLAPSE_ALL));

The rowIndex value is the virtual row index at the time the event is dispatched.

RowExpandPlugin and MasterRowPlugin both expose expandable row experiences, but their rendering models are different:

CapabilityRowExpandPluginMasterRowPlugin
Rendering modelInline expanded row in the regular row viewportOverlay-rendered master-detail row
Required pluginsRowExpandPluginMasterRowPlugin (OverlayPlugin is auto-installed)
Toggle setupSet expand: true on a columnUse EXPAND_COLUMN or dispatch ROW_MASTER
Best forNested grids, row forms, compact detail rowsFull-width master-detail content and pinned-area spanning layouts
Layout scopeConstrained by regular grid row and columnsCan span across the grid through overlay rendering

For the overlay-based master-detail implementation, read the Master Rows guide or the Row Master API.

  • Inline edit forms, as shown in the Form Edit example.
  • Nested grids inside expanded rows, as shown in the Nested Grid guide.
  • Compact row detail panels that do not need to span pinned columns or the full grid.