Row Data Source

Client Row Data Source

Use LyteNyte Grid's client data source when you can load the entire dataset into the browser. This source stores all rows in memory and assumes the complete dataset is available on the client. It is the simplest of all data sources, but also the most feature rich.

Create a Client Data Source

Import and call the useClientRowDataSource hook to create a client data source. Pass it the initial row data. The hook returns an object that implements the row data source interface. For details, see the API Reference.

Client Row Data Source

Top and Bottom Data

You can include pinned rows at the top and bottom of the grid. These rows remain visible while users scroll through the main dataset.

Pinned Top and Bottom

Access All Data

The LyteNyte Grid API does not offer a single method to retrieve every row from the grid because each data source loads differently. The client-side row data source includes a rowData method that returns all rows currently loaded in memory.

const ds = useClientRowDataSource({
  data: companiesWithPricePerf,
});
 
// Get all row data in a flat array
const rowData = ds.rowData("flat");