Data mode guide
Pick how the grid gets its rows, and decide whether the grid or your server applies the sort, filter, and search text.
A data mode is one way the grid gets its rows. The mode also decides who applies the sort, the filter, and the search text. Use the two tables below to pick both.
Pick the strategy for your data
| Your data | Data mode | Start here |
|---|---|---|
| The browser holds every row. | Local array | Render your first grid |
| The browser holds every row and shows one page at a time. | Client pagination | Client pagination |
| Your API returns one page for each request. | Pages mode | Load rows by page |
| You fetch the pages yourself, for example with a cache. | Own fetch with useDataGridServerPager | Fetch the pages yourself |
| Your API reads rows by offset and returns the row count. | Scroll mode, random access | Load rows while scrolling |
| Your API returns a next cursor and no row count. | Scroll mode, sequential source | Load without row count |
Live values add to any of these modes. See Push live values. One grid cannot use scroll mode and pagination together.
Pick where the spec runs
The spec is what the user chose: sorts, filters, and searchText.
| Local array | Server mode | |
|---|---|---|
| Who applies the spec | The grid, over data | Your server |
| Mode props | The defaults | sortMode="server" and filterMode="server" |
| Rows the grid holds | All of data | A page or the loaded blocks |
useDataGridServerRows sets both mode props for you. When data holds only part of the result, run the spec on the server. A client sort or filter cannot see the rows the grid never fetched, and it warns once in development.
Query server rows shows how the server reads the spec. Move from client rows to server rows lists what changes for a grid that leaves the local array. Data mode support lists each feature per mode.