fix(grid): allow rerunning exact total row count from status
This commit is contained in:
1 parent
425ca055ea
commit
c0abc26fe8
7 files changed
+165
-4
No files matched your search
@@ -42,6 +42,11 @@ export function dataGridTotalRowCountLabelKey(totalRowCountIsExact: boolean, ine
|
||||
return inexactMode === "estimated" ? "grid.totalRowCountEstimated" : "grid.totalRowCountAtLeast";
|
||||
}
|
||||
|
||||
export function showDataGridRerunTotalCountAction(options: { canCalculateTotalRowCount: boolean; displayedTotalRowCount?: number; totalRowCountIsExact: boolean }): boolean {
|
||||
if (!options.canCalculateTotalRowCount || options.totalRowCountIsExact !== true) return false;
|
||||
return typeof options.displayedTotalRowCount === "number" && Number.isFinite(options.displayedTotalRowCount) && options.displayedTotalRowCount >= 0;
|
||||
}
|
||||
|
||||
export function resolveDataGridPaginationTotal(options: { paginationTotalRowCount?: number; serverKnownTotalRowCount?: number; totalRowCountIsExact: boolean; maxRows?: number }): number | undefined {
|
||||
const total = options.paginationTotalRowCount ?? (options.totalRowCountIsExact ? options.serverKnownTotalRowCount : undefined);
|
||||
if (total === undefined || options.maxRows === undefined) return total;
|
||||
|
||||
Reference in new issue
Block a user