hideable
For a column that must stay on screen.
| 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”hideable: false disables the column menu’s « Hide column » for it, and the columns chooser cannot untick
it. A saved state that hides it is told, and the column stays shown. Your code can still hide it with
hidden.
The grid never lets the user hide the last shown column, whatever this option says.
Example
Section titled “Example”import { createGrid, type GridMessages } from '@dzgrid/dom';import { columnMenu } from '@dzgrid/dom/column-menu';import { EN_COLUMN_MENU } from '@dzgrid/dom/locales/en-column-menu';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_COLUMN_MENU.text } };
createGrid<Tool>(document.getElementById('tools')!, { rows: [{ id: 't1', name: 'Hammer', shelf: 2, notes: 'Claw, 450 g' }], columns: [ { id: 'name', header: 'Tool', hideable: false }, { id: 'notes', header: 'Notes' }, ], getRowId: (r) => r.id, messages, features: [columnMenu()],});Live demo
Section titled “Live demo”Open Tool’s menu (⋮): « Hide column » is disabled. Notes’ is not.