hidden
A column that exists but is not shown when the grid starts.
| Type | boolean |
|---|---|
| Default | false |
Live update (update()) | Yes — give the columns again (update({ columns })) |
| Declared in | packages/core/src/columns/defs.ts |
What it does
Section titled “What it does”A hidden column is still a column: it keeps its sort and its filter, and it can be shown again.
The user shows it from the columns chooser; your code from the grid state or by giving the columns again. What the user
chose wins over hidden and is part of the saved state; the column menu’s « Reset columns » gives the definition’s
back.
By default, hidden columns are left out of the files and of print, which show the visible columns.
Example
Section titled “Example”import { createGrid } from '@dzgrid/dom';import { EN } from '@dzgrid/dom/locales/en';
type Tool = { id: string; name: string; shelf: number; notes: string };
createGrid<Tool>(document.getElementById('tools')!, { rows: [{ id: 't1', name: 'Hammer', shelf: 2, notes: 'Claw, 450 g' }], columns: [ { id: 'name', header: 'Tool' }, { id: 'shelf', header: 'Shelf', type: 'number', hidden: true }, ], getRowId: (r) => r.id, messages: EN,});Live demo
Section titled “Live demo”Shelf is hidden: open a menu (⋮), then « Choose columns… » to show it.