FreeGridv1.15.1한국어

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.

EventWhenPayload
gridReadyOnce, right after createGrid returns (a listener added on the next line hears it){ api }
firstDataRenderedOnce, 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

FrameworkgridReadyfirstDataRendered
ReactonGridReadyonFirstDataRendered
Vue@grid-ready@first-data-rendered
Angular(gridReady)(firstDataRendered)
SvelteonGridReadyonFirstDataRendered

Other new events: cellNoteChange, calculatedColumnsChange and detailToggleAll — see Events.