Asynchronous data sources can be used to lazy load data on demand.
An asynchronous data source represents one or more tables of data.
const studioProperties = {
data: {
sources: [{
id: 'medalsSource',
dataShape: 'row',
getData: async (tableId) => {
const data = await fetchData(tableId);
return { data };
},
tables: [
{
id: 'medals',
fields: [
{
id: 'athlete',
format: 'textFormat',
},
// ... other fields
],
},
// ... other tables
],
}],
},
// other studio properties ...
}Asynchronous data sources can return row-based or column-based data. This is determined by the dataShape property.
Properties available on the AgDataSourceDefinition<TDataShape extends AgDataShape, TFormats extends AgFormats = AgFormats> interface.
Data source ID |
Data source display name. If not provided, a formatted version of id will be used. |
Callback to return the data for the provided table and fields |
'row' if the data is row-based, or 'column' if the data is column-based. |
One or more tables that are provided by this data source. |
Multiple Tables Copy Link
When multiple tables are provided, they can be linked by providing Relationships.
Reloading Data Copy Link
Data can be reloaded by calling api.reload().