Skip to content

PinnedRowsPlugin

Pinned Rows (Status Bar) Plugin for tbw-grid

Creates fixed status bars at the top or bottom of the grid for displaying aggregations, row counts, or custom content. Think of it as the “totals row” you’d see in a spreadsheet— always visible regardless of scroll position.

import { PinnedRowsPlugin } from '@toolbox-web/grid/plugins/pinned-rows';
OptionTypeDefaultDescription
position'top' | 'bottom''bottom'Status bar position
showRowCountbooleantrueShow total row count
showSelectedCountbooleantrueShow selected row count
showFilteredCountbooleantrueShow filtered row count
fullWidthbooleanfalseDefault fullWidth for aggregation rows
aggregationRowsAggregationRowConfig[]-Aggregation row configs
FunctionDescription
sumSum of values
avgAverage of values
countCount of rows
minMinimum value
maxMaximum value
PropertyDefaultDescription
--tbw-pinned-rows-bgvar(--tbw-color-panel-bg)Status bar background
--tbw-pinned-rows-bordervar(--tbw-color-border)Status bar border
import '@toolbox-web/grid';
import { PinnedRowsPlugin } from '@toolbox-web/grid/plugins/pinned-rows';
grid.gridConfig = {
columns: [
{ field: 'product', header: 'Product' },
{ field: 'quantity', header: 'Qty', type: 'number' },
{ field: 'price', header: 'Price', type: 'currency' },
],
plugins: [
new PinnedRowsPlugin({
position: 'bottom',
showRowCount: true,
aggregationRows: [
{
id: 'totals',
aggregators: { quantity: 'sum', price: 'sum' },
cells: { product: 'Totals:' },
},
],
}),
],
};

Extends BaseGridPlugin

Inherited methods like attach(), detach(), afterRender(), etc. are documented in the base class.

Refresh the status bar to reflect current grid state.

refresh(): void

Get the current status bar context.

getContext(): PinnedRowsContext

PinnedRowsContext - The context with row counts and other info


Add a custom panel to the info bar.

addPanel(panel: PinnedRowsPanel): void
NameTypeDescription
panelPinnedRowsPanelThe panel configuration to add

Remove a custom panel by ID.

removePanel(id: string): void
NameTypeDescription
idstringThe panel ID to remove

Add an aggregation row.

addAggregationRow(row: AggregationRowConfig): void
NameTypeDescription
rowAggregationRowConfigThe aggregation row configuration

Remove an aggregation row by ID.

removeAggregationRow(id: string): void
NameTypeDescription
idstringThe aggregation row ID to remove

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