Skip to content

busy

For an application that reloads rows it keeps on screen — a poll every minute, its own refresh button.

Typeboolean
Defaultfalse
Live update (update())Yes
Angularthe [busy] input
<dz-grid>the busy attribute
Declared inpackages/dom/src/settings.ts

true: the grid says aria-busy="true" at once, and after 200 ms shows a thin bar under the header; once shown, the bar stays at least 400 ms, so a quick reload does not flicker. The rows stay readable and usable. Nothing is announced: a reader is not interrupted for a refresh. false ends it.

A server’s rows (source) do this by themselves when a request is made with rows kept on screen; busy is for the rows you give. The bar never shows with the « Loading… » overlay. Under motion: false or reduced motion, the bar is still; a part can draw your own instead (slots()).

import { createGrid } from '@dzgrid/dom';
import { EN } from '@dzgrid/dom/locales/en';
type Train = { id: string; line: string; delay: number };
const grid = createGrid<Train>(document.getElementById('trains')!, {
rows: [{ id: 't1', line: 'Coast line', delay: 4 }],
columns: [{ id: 'line', header: 'Line' }, { id: 'delay', header: 'Delay (min)', type: 'number' }],
getRowId: (t) => t.id,
messages: EN,
});
setInterval(async () => {
grid.update({ busy: true });
const rows = (await (await fetch('/api/trains')).json()) as Train[];
grid.update({ rows, busy: false });
}, 60_000);

busy: true — the rows stay, a thin bar under the header says they are being reloaded.