Skip to content

In-memory and REST data sources

View as Markdown

Use the in-memory source for browser-owned rows, examples, and tests. Use the REST helpers when application endpoints own remote rows and persistence.

const dataSource = inMemoryGridDataSource({
schema,
tree: [
{
rowKey: "project-1",
levelName: "projects",
columns: { name: "Migration" },
},
],
levels: {
projects: {
sortMode: "client",
filterMode: "none",
paginationMode: "none",
},
},
});

The in-memory source is not an authorization boundary.

restLevelSource() and restGridDataSource() separate mutable query state from request construction:

  • rowQuery stores mutable page, page-size, sort, and filter values.
  • buildRowsRequest adds fixed filters, parent-row constraints, or transport defaults before a fetch runs.
  • sourceOwnedRowQuery(initial) keeps query state inside a level source.
  • hostBackedRowQuery(state) adapts application query state to the same source command contract.

Use source-owned query state for embedded levels and child levels without visible controls. Use host-backed query state when toolbar controls, URL state, exports, and row loading must read the same query store.

Remote endpoints remain responsible for authorization, validation, persistence, and conflict handling.