Skip to content

rowHeight

The rows’ height in pixels, when the three heights of density are not the one you need.

Typenumber
Defaultthe density’s: 28, 32 or 40 px at 16 px text
Live update (update())Yes
Angularthe [rowHeight] input
<dz-grid>the row-height attribute
Declared inpackages/dom/src/settings.ts

A number from 24 to 1 000: the row height at a 16 px text size. The grid grows it with the reader’s text size, as it does the density’s heights, so a reader who makes the text bigger still gets rows that hold it. The header rows take it too, unless headerHeight sets them.

Anything else (a string, 12, 5 000) is told as an invalid-setting warning and the density’s height is used. The cells’ side padding still follows the density. While rowHeight is set, the column menu does not offer the density.

Under a rowHeight, every row keeps that height, even with @dzgrid/dom/auto-height: a column’s wrap puts its text on several lines and cuts what does not fit.

import { createGrid } from '@dzgrid/dom';
import { EN } from '@dzgrid/dom/locales/en';
type Tide = { id: string; port: string; high: number };
const grid = createGrid<Tide>(document.getElementById('tides')!, {
rows: [{ id: 't1', port: 'Gull Harbour', high: 4.2 }],
columns: [{ id: 'port', header: 'Port' }, { id: 'high', header: 'High water (m)', type: 'number' }],
getRowId: (t) => t.id,
messages: EN,
rowHeight: 48,
});
grid.update({ rowHeight: undefined }); // back to the density's height

Rows and header 48 px tall at a 16 px text size.