Skip to content

hidden

A column that exists but is not shown when the grid starts.

Typeboolean
Defaultfalse
Live update (update())Yes — give the columns again (update({ columns }))
Declared inpackages/core/src/columns/defs.ts

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.

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,
});

Shelf is hidden: open a menu (⋮), then « Choose columns… » to show it.