perspectives - prepare for nested incremental load

This commit is contained in:
Jan Prochazka
2022-07-21 18:10:43 +02:00
parent 8f1343bc42
commit 28e06166e0
2 changed files with 51 additions and 3 deletions

View File

@@ -24,6 +24,18 @@ export class PerspectiveDataProvider {
async loadData(props: PerspectiveDataLoadProps): Promise<{ rows: any[]; incomplete: boolean }> {
const tableCache = this.cache.getTableCache(props);
if (props.bindingColumns) {
const { cached, uncached } = tableCache.getBindingGroups(props);
const counts = await this.loader.loadGrouping({
...props,
bindingValues: uncached,
});
for (const countItem of counts) {
const { _perspective_group_size_, ...fields } = countItem;
tableCache.storeGroupSize(props, fields, _perspective_group_size_);
}
}
if (props.topCount <= tableCache.loadedCount) {
return tableCache.getRowsResult(props);
}