Grid ready and first rows
gridReady fires right after createGrid returns and firstDataRendered once the first rows are on screen (for a datasource, once the first block arrived), in every framework wrapper.
Two events tell you when the grid is ready for code that needs it: restoring a view, sizing columns to their content, scrolling to a row from the URL.
| Event | When | Payload |
|---|---|---|
| gridReady | Once, right after createGrid returns (a listener added on the next line hears it) | { api } |
| firstDataRendered | Once, when the first data rows are drawn (with a datasource: after the first block arrived) | { rowCount } |
const grid = createGrid(el, { columns, datasource });
grid.on('gridReady', () => grid.setState(savedView));
grid.on('firstDataRendered', () => {
grid.autoSizeColumns(); // the columns fit what is on screen
const row = Number(new URLSearchParams(location.search).get('row'));
if (row) grid.scrollToRow(row); // ?row=120 from a link
});In the wrappers
| Framework | gridReady | firstDataRendered |
|---|---|---|
| React | onGridReady | onFirstDataRendered |
| Vue | @grid-ready | @first-data-rendered |
| Angular | (gridReady) | (firstDataRendered) |
| Svelte | onGridReady | onFirstDataRendered |
Other new events: cellNoteChange, calculatedColumnsChange and detailToggleAll — see Events.