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

Server Row Overview

Use the server row data source to load and manage server-side row data in LyteNyte Grid.

The server data source handles the largest datasets in LyteNyte Grid by using partial data loading to render millions of rows.

What Problem Does Server Data Loading Solve?

When the amount of row data exceeds what is feasible to transfer to a browser at once, a partial data loading solution becomes necessary. Developers typically choose one of these approaches:

  • Pagination: Load one page of data at a time.
  • Infinite scrolling: Lazily load more data as the user scrolls down.
  • Viewport-based loading: Load only the rows currently in view.

LyteNyte Grid supports all three approaches. The guides in this section focus on viewport-based loading, which is flexible but can be complex to configure. Since LyteNyte Grid handles client-side loading, you only need to implement the server-side logic.

Why Use Server Data Loading?

Server data loading delivers a client-side experience with the expected trade-off of network latency. It provides:

  • Direct Row Interaction: When a user scrolls to a specific index, like row 9,500, the grid requests the surrounding rows from the server.
  • Advanced Operations: Natively supports pivoting and grouping, which are complex or limited when using pagination and infinite scrolling.

Enabling Server Data Source

To enable the server data source, developers must provide LyteNyte Grid with:

  • Total Row Count: Sets the size of the scrollable area. With row grouping, provide group-specific row counts that the grid combines to represent the full dataset.
  • queryFn: A function LyteNyte Grid calls to fetch rows from your server.

Server Data Flow

The server data source follows a well defined lifecycle:

  1. Initial Data Fetch

    When the grid first renders, LyteNyte Grid calls the dataFetcher function with an initial request payload. At this stage, LyteNyte Grid has no cached view data. The initial response provides the rowCount and the first rows to display.

  2. User Scrolls (View Changes)

    LyteNyte Grid tracks which rows are visible. When the view changes, it determines whether to request more data from the server. If necessary, multiple requests may be issued.

  3. Actions That Reset the View

    Certain actions trigger a full view reset and a fresh data request. Sorting a column or grouping rows, for example, alters the dataset and requires the grid to re-fetch the data.

Other operations extend this basic flow. LyteNyte Grid’s server data source supports various advanced configurations. A simple example of a server data loading grid is shown below.

Basic Server Data

Fork code on stack blitzFork code on code sandbox

Next Steps