Skip to content

label

The name a screen reader says when the focus comes into the grid.

Typestring
Defaultthe bundle’s grid.label
Live update (update())Yes
Angularthe [label] input
<dz-grid>the label attribute
Declared inpackages/dom/src/settings.ts

A text in the reader’s language, given as is: the grid does not translate it. Left out, the grid takes its bundle’s grid.label (« Data grid »), which says nothing about the rows — name every grid that shares a page with another.

The name goes on the grid’s scrolling area, and into the names of what belongs to it: the pager (« Pagination, Invoices »), the status bar. Changing it with update() renames them at once.

import { createGrid } from '@dzgrid/dom';
import { EN } from '@dzgrid/dom/locales/en';
type Invoice = { id: string; client: string; total: number };
const grid = createGrid<Invoice>(document.getElementById('invoices')!, {
rows: [{ id: 'i1', client: 'Blue Mill', total: 1250 }],
columns: [{ id: 'client', header: 'Client' }, { id: 'total', header: 'Total', type: 'number' }],
getRowId: (i) => i.id,
messages: EN,
label: 'Invoices',
});
grid.update({ label: 'Invoices, March' });