Aggregates and Footer V1
Use footerLabel and aggregate to add a summary footer to DyonaGrid.
const columns: DyonaGridColumn[] = [
{
field: 'invoice',
headerName: 'Invoice',
footerLabel: 'PAGE TOTAL',
},
{
field: 'balance',
headerName: 'Balance',
format: {type: 'currency', currency: 'ARS'},
aggregate: {type: 'sum'},
},
];
Try the complete DyonaGrid example in the Lab
footerLabel
footerLabel?: string adds text to a column footer. It can be used without an aggregate. When a column has both footerLabel and aggregate, the footer displays Label: value.
The footer appears only when at least one visible data column has a footerLabel or aggregate.
aggregate
aggregate.type supports sum, avg, min, max, and count.
sum, avg, min, and max use only finite JavaScript number values. They ignore null, undefined, strings, NaN, and infinite values. When there are no valid numbers, they display —.
count counts every value that is not null or undefined. Values such as 0, false, and '' count. When no values are present, it displays 0.
count never applies a currency, percent, or number formatter. The other aggregate types reuse the column's declared format when it applies.
Layout and remote data
The footer respects column hide/show, reorder, and resize. Technical selection, Actions, and delete columns retain empty cells for alignment, but do not calculate aggregates. The footer does not receive conditional styles or semaphorization.
In remote mode, V1 calculates aggregates only from rows currently loaded by the grid. It does not calculate a global Data Source total. For that reason, a paginated remote grid should use a label such as PAGE TOTAL, not a label that implies a global total.