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

Server Row Pinning

Pin rows to the top or bottom of the viewport to keep them visible. With the server data source, the server returns these in a pinned-row response.

Server Pinned Rows

The server data source does not track viewport changes for pinned rows because they remain fixed. To supply pinned rows, return a DataResponsePinned object for every viewport request, including the initial load. For details, see the Data Interface guide.

This example pins rows to the top and bottom of the grid. The server always returns both pinned and scrollable rows. Note that pinned rows are always leaf rows.

Server Row Pinning

Fork code on stack blitzFork code on code sandbox

Pushing Pinned Row Updates

The server can update pinned rows on any server data source request. To update pinned rows without a viewport change, call the server data source’s pushResponses method:

const ds = useServerDataSource<MovieData>({
queryFn: (params) => {
return Server(params.requests);
},
//...
});
// Push responses
ds.pushResponses(...)

The pushResponses method lets the client push response objects into the server data source as if the server returned them.

In the demo below, Pin One Top pins a single row to the top, and Remove Pinned removes the pinned row. Both actions run on the client without a server response.

Pushing Pinned Rows

Fork code on stack blitzFork code on code sandbox

pushResponses is one way to push data into the grid. For more details, see the Data Pushing or Pulling guide.

Next Steps