Skip to content

System columns

Some columns exist to support grid behaviour rather than to display user data — a row-action menu, a status indicator, a row number, the selection checkbox the grid injects for you. These are system columns (also called utility columns in the API).

Mark any column with utility: true and the grid will treat it as a system column:

import { queryGrid } from '@toolbox-web/grid';
const grid = queryGrid('tbw-grid');
grid.gridConfig = {
columns: [
{
field: '__actions',
header: '',
width: 80,
utility: true, // ← marks this as a system column
resizable: false,
sortable: false,
filterable: false,
viewRenderer: ({ row }) => createActionsButton(row),
},
{ field: 'id', header: 'ID' },
{ field: 'name', header: 'Name' },
],
};

The column is rendered in the grid (header + cells, with your viewRenderer / headerRenderer / cellRenderer). It is excluded from everything else:

SurfaceBehaviour for utility: true
Visibility panelNot listed — users cannot toggle it on/off
Column reorderLocked in place (header drag-drop and visibility-panel drag both)
PrintHidden by PrintPlugin during print
Clipboard copySkipped by ClipboardPlugin
Export (CSV/JSON/XLSX)Skipped by ExportPlugin
Range / row selectionClick does not extend a selection range
Filter UINo filter button rendered, no filter model entry
Cell renderingRendered normally — your renderer runs, custom CSS applies

In short: visible in the grid, hidden from the system.

  • Row action menu — buttons for edit / delete / open-detail
  • Status indicator — a coloured dot or icon derived from row state
  • Row number — a 1-based index column that should never be sorted or exported
  • Custom expander — a developer-controlled toggle separate from MasterDetail / Tree
  • Drag handle — a visual handle for row reorder (the built-in RowReorder plugin already does this)

The same flag is used internally for columns the grid synthesises:

PluginSynthesised column
SelectionPluginCheckbox column (__tbw_checkbox) when checkbox: true
MasterDetailPlugin / TreePlugin / GroupingRowsPluginExpander column (__tbw_expander)
RowReorderPluginDrag handle column

You can therefore safely mix your own utility columns with built-in ones — they all play by the same rules.

If you want a system column to appear in the print output, set printHidden: false explicitly:

{ field: '__rowNumber', header: '#', utility: true, printHidden: false }

There is no per-surface opt-out for the other behaviours yet — file an issue if you need one.

FlagEffect
utilityAll-of-the-above system-column behaviour (the umbrella flag)
lockPositionLocks reorder only — column still appears in chooser, print, export
lockVisibleLocks visibility toggle only — appears in chooser but cannot be hidden
printHiddenHides during print only
hiddenHides the column entirely from the grid (and all its features)

Use utility when you want all of those behaviours at once. Use the individual flags when you want finer control.

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