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

Infinite Row Sorting

Provide a sort model to the server data source to infinitely load sorted rows as the user scrolls.

Note

This guide covers sorting on infinite server row data. For client-side sorting, see the Client Row Sorting guide.

Sorting Infinite Rows

To sort rows on the server, define a sort model and send it with each request. The useServerDataSource hook accepts the sort model as part of the queryKey. The sort model can use any structure that fits your application. In most cases, match the format your server or database expects.

The demo below shows infinite row sorting. Click a column header to update that column’s sort state.

Sort Infinite Rows

Fork code on stack blitzFork code on code sandbox

The demo code applies sort state to columns. By extending the grid’s API, you can update the sort property on each column directly. The extended API then applies the appropriate sort when the user clicks a column header.

Next Steps