diff --git a/_data/components/otableData/05tableColumnAggregate.yml b/_data/components/otableData/05tableColumnAggregate.yml index ea9411402..b5b6456b9 100644 --- a/_data/components/otableData/05tableColumnAggregate.yml +++ b/_data/components/otableData/05tableColumnAggregate.yml @@ -22,8 +22,8 @@ attributes: [{ required : "", description : "Default functions aggregate" },{ - name: "function-aggregate", - type: "(value:any[]) => number ", + name: "aggregate-function", + type: "(value: any[], columnAttr?: string, table?: OTableComponent) => number | Promise", default : "", required : "", description : "Custom function aggregate" diff --git a/_data/components/otableData/15tableColumnsGroupingColumn.yml b/_data/components/otableData/15tableColumnsGroupingColumn.yml index 1a7d68a3a..cc1778f23 100644 --- a/_data/components/otableData/15tableColumnsGroupingColumn.yml +++ b/_data/components/otableData/15tableColumnsGroupingColumn.yml @@ -27,7 +27,7 @@ attributes: [{ description : "Default functions aggregate" },{ name: "aggregate-function", - type: " (value: any[]) => number", + type: "(value: any[], columnAttr?: string, table?: OTableComponent) => number | Promise", default: "", required: "", description: "Function that calculates a value on the values of the column 'attr'" diff --git a/docs/components/data/35-o-table.component.md b/docs/components/data/35-o-table.component.md index 668e05182..8ecef4dfc 100644 --- a/docs/components/data/35-o-table.component.md +++ b/docs/components/data/35-o-table.component.md @@ -914,7 +914,7 @@ The `o-table` component supports *fixed header* and *footer* setting `fixed-head ### Aggregates -Oftentimes, when displaying numbers in the table, users would like to be able to see the results from aggregate calculations at the bottom of the table columns. The `o-table` component has support for the mostly used aggregate functions (count,sum,avg,min,max). +Often when displaying numbers in a table, users want to show summary results of aggregate calculations at the bottom of the table columns. The `o‑table` component supports commonly used aggregation functions (**count**, **sum**, **avg**, **min**, **max**) using `aggregate` input and also allows specifying a **custom aggregation function** using the `aggregate-function` input, which may return either a **synchronous number** or a **Promise** (for asynchronous operations).

Example

@@ -928,7 +928,7 @@ Oftentimes, when displaying numbers in the table, users would like to be able to - + ``` @@ -1458,7 +1458,7 @@ By default, the table is *groupable* and for grouping/ungrouping by one o more c If there is at least one grouping, the table automatically applies the *sum function* on those of type `currency`, `integer` and `real` and whose value will be displayed in the grouped row. If you want to exclude this function from being performed, you must add this column in the `excluded-aggregate-columns` attribute in `o-table-columns-grouping` component. - You can configure the *aggregate functions* (count,sum,avg,min,max) in the `o-table-columns-grouping` component. Additionally, you can specify aggregate function to be applied with `function-aggregate` attribute. + You can configure the *aggregate functions* (count,sum,avg,min,max) in the `o-table-columns-grouping` component. Additionally, you can specify aggregate function to be applied with `aggregate-function` attribute. By default, when you change the aggregate function in a column, it will change in all grouped rows of the same level, if you want to avoid this behavior you must add `change-aggregate-same-level="no"`.