Core Features

Advanced Features

React Data GridSSRM Loading Rows

Version 36.2.0
Enterprise

The Server-Side Row Model displays loading rows while it requests data from the datasource, including when scrolling or expanding groups. Full-width loading rows are displayed by default; skeleton loading displays an indicator in each cell instead.

These loading rows are managed by the row model, not by the loading or loadingRows grid options. For application-controlled loading with the Client-Side Row Model, see Loading Rows.

Full Width Loading Row Copy Link

The example below demonstrates replacing the Provided Loading Component with a Custom Loading Component.

  • Custom Loading Component is supplied via gridOptions.loadingCellRenderer.
  • Custom Loading Component Parameters are supplied using gridOptions.loadingCellRendererParams.
  • Example simulates a long delay to display the spinner clearly.
  • Scrolling the grid will request more rows and again display the loading cell renderer.

See Loading Cell Component for component interfaces, parameters and dynamic component selection.

Failed Loading Copy Link

When using a Custom Loading Component, you can add handling for loading failures in the component directly.

In the example below, note that:

  • Custom Loading Component is supplied via gridOptions.loadingCellRenderer.
  • Custom Loading Component Parameters are supplied using gridOptions.loadingCellRendererParams.
  • The example simulates a long delay to display the spinner clearly and simulates a loading failure.

For retrying failed datasource requests, see Load Retry.

Skeleton Loading Copy Link

The Server-Side Row Model can display loading indicators in cells by enabling suppressServerSideFullWidthLoadingRow.

const gridOptions = {
    suppressServerSideFullWidthLoadingRow: true,
};

Custom Loading Cells Copy Link

Set loadingCellRenderer on a column definition to customise its loading cells.

const gridOptions = {
    suppressServerSideFullWidthLoadingRow: true,
    columnDefs: [
        { field: 'country', loadingCellRenderer: CustomLoadingCellRenderer },
        // More columns, with no load renderer...
    ],
    defaultColDef: {
        loadingCellRenderer: () => '',
    },
};

The above example demonstrates the following:

  • suppressServerSideFullWidthLoadingRow is enabled, preventing the grid from defaulting to full width loading.
  • loadingCellRenderer is configured on the Country column, allowing a loading spinner to be displayed for just this column.
  • loadingCellRenderer is configured on defaultColDef to leave loading cells empty in the other columns.

See Loading Cell Component for the shared component API.