LyteNyte Grid logo for light mode. Links back to the documentation home page.
Server Data Loading

Handling Load Failures

Use the server data source's built-in error recovery mechanisms to manage and retry failed network requests.

Handling Initial Request Failure

When the server data source initializes, it sends an initial data request. If this fails, LyteNyte Grid can’t retry specific slices because none have loaded. To recover, reset the grid as demonstrated below:

Initial Load Error

Fork code on stack blitzFork code on code sandbox

Clicking the Retry / Resolve button calls the reset method on the server data source, which resends the initial data request to the server.

Handle Slice Failures

Even after the initial request succeeds, subsequent requests can still fail. The LyteNyte Grid server data source provides the retry method to reattempt failed data requests. This method clears the error state and resends only the failed requests that are currently in view; failed requests outside the view are skipped but still have their error state cleared.

In the following demo, scroll down to trigger failed requests. Click the Retry Failed button to clear the error state and successfully re-request the affected rows.

Failed Row Slice

Fork code on stack blitzFork code on code sandbox

Handling Group Failures

The retry method also recovers failed group expansions. Calling it re-requests all errored fetches associated with that group. In the demo below, expand a group to trigger an intentional failure, then click the exclamation icon to successfully retry the request.

Group Expansion Failure

Fork code on stack blitzFork code on code sandbox

The retry method is invoked in the GroupCellRenderer button component:

<button
onClick={() => {
(grid.state.rowDataSource.get() as RowDataSourceServer<SalaryData>).retry();
}}
>
<ExclamationTriangleIcon />
</button>

Next Steps