Skip to content

Interface: DataSource\<TRow\>

Defined in: src/data/data-source.ts:21

Abstraction over the grid’s data backend.

M1 ships InMemoryDataSource (synchronous, client-side). M4 adds optional methods for server-side operations — lazy loading, pagination, live updates, where-used, and export-all.

The grid feature-detects capabilities via capabilities() and adapts its behavior accordingly. Implementations only need to provide the methods they support.

Type Parameters

TRow

TRow

Methods

capabilities()?

optional capabilities(): DataSourceCapabilities

Defined in: src/data/data-source.ts:50

Optional. Declares which server-side capabilities are supported. The grid calls this at mount to determine behavior.

Returns

DataSourceCapabilities


exportAll()?

optional exportAll(query?): Promise<TRow[]>

Defined in: src/data/data-source.ts:56

Optional. Export all data bypassing pagination. Used by the export feature when scope is ‘all’.

Parameters

query?

DataQuery

Returns

Promise<TRow[]>


load()

load(query?): TRow[] | Promise<TRow[]>

Defined in: src/data/data-source.ts:26

Returns rows. Accepts an optional query for server-side sort/filter. Synchronous for in-memory; async for server-side sources.

Parameters

query?

DataQuery

Returns

TRow[] | Promise<TRow[]>


loadChildren()?

optional loadChildren(parentId, query?): Promise<TRow[]>

Defined in: src/data/data-source.ts:32

Optional. Load children of a specific node (lazy tree). Called when a user expands a node whose children haven’t been loaded.

Parameters

parentId

string

query?

DataQuery

Returns

Promise<TRow[]>


loadPage()?

optional loadPage(params): Promise<PageResult<TRow>>

Defined in: src/data/data-source.ts:38

Optional. Load a page of flat data. Used when pagination is enabled.

Parameters

params

PageParams

Returns

Promise<PageResult<TRow>>


subscribe()?

optional subscribe(onChange): () => void

Defined in: src/data/data-source.ts:44

Optional. Subscribe to live data changes. Returns an unsubscribe function.

Parameters

onChange

DataChangeHandler<TRow>

Returns

() => void


whereUsed()?

optional whereUsed(nodeId): Promise<WhereUsedResult<TRow>[]>

Defined in: src/data/data-source.ts:62

Optional. Where-used / reverse BOM lookup. Given a node id, returns all parent assemblies that use it.

Parameters

nodeId

string

Returns

Promise<WhereUsedResult<TRow>[]>