Interface AggregateFooterRowIf<T>

One total row of an AreaModelAggregateFooter: the aggregates by column property and an optional label.

Example

const sumRow: AggregateFooterRowIf<Order> = { label: "Sum", aggregates: { quantity: "sum", total: "sum" } };
const avgRow: AggregateFooterRowIf<Order> = {
label: (rowCount, results) => `Ø of ${rowCount} orders`,
aggregates: { total: { aggregator: "avg", format: v => `${(v as number).toFixed(2)} €` } }
};

Since

1.1.94

Type Parameters

  • T = any

Hierarchy

  • AggregateFooterRowIf

Properties

Properties

aggregates: AggregateSpecMap<T>

Key = property of the column that shows the result (a key without a column is only in getResults()).

label?: string | ((rowCount, results) => string)

Text in the label column (always set as text, never as HTML). Default: "6 rows" – or, in a footer with several rows whose aggregates all use the same built-in aggregator, its word ("Sum", "Average", "Min" …).

Type declaration

    • (rowCount, results): string
    • Parameters

      • rowCount: number
      • results: Record<string, unknown>

      Returns string