From 2ad86f7ac27a62e16de6955b144f856a6f246109 Mon Sep 17 00:00:00 2001 From: Patricia Martinez Tilve Date: Tue, 11 Nov 2025 13:50:15 +0100 Subject: [PATCH 1/2] Updated documentation about aggregate-function input --- _data/components/otableData/05tableColumnAggregate.yml | 4 ++-- .../components/otableData/15tableColumnsGroupingColumn.yml | 2 +- docs/components/data/35-o-table.component.md | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) 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..1afdcf6e1 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 `operator` 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"`. From b07655a1cb70e9e2f2be298ef09aeee8b57ef43d Mon Sep 17 00:00:00 2001 From: Patricia Martinez Tilve Date: Tue, 11 Nov 2025 17:28:42 +0100 Subject: [PATCH 2/2] Fixed typo --- docs/components/data/35-o-table.component.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/components/data/35-o-table.component.md b/docs/components/data/35-o-table.component.md index 1afdcf6e1..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 -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 `operator` 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). +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