chooser
Keeps a column out of the list where the user shows, hides and orders columns.
| Type | false |
|---|---|
| Default | not set |
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”The columns chooser (columnsChooser() from @dzgrid/dom/columns-panel) lists every column with a box to
show or hide it. chooser: false leaves this column out of that list — a technical column, one your app shows on its
own terms. The column menu can still hide it, unless hideable is false.
Example
Section titled “Example”import { createGrid, type GridMessages } from '@dzgrid/dom';import { columnsChooser } from '@dzgrid/dom/columns-panel';import { EN_COLUMNS } from '@dzgrid/dom/locales/en-columns';import { EN } from '@dzgrid/dom/locales/en';
type Tool = { id: string; name: string; shelf: number; notes: string };
const messages: GridMessages = { ...EN, text: { ...EN.text, ...EN_COLUMNS.text } };
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', chooser: false }, ], getRowId: (r) => r.id, messages, features: [columnsChooser()],});Live demo
Section titled “Live demo”Open a menu (⋮), then « Choose columns… »: Shelf is not in the list.