Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ attributes: [{
name: "min-decimal-digits"
},{
name: "max-decimal-digits"
},{
name: "currency-symbol-column",
type: "string",
default: "$",
description: "Column name containing the currency symbol for each row. Supports nested properties using dot notation (e.g., 'currency.symbol')"
}]

inherit_properties: [{
Expand Down
39 changes: 38 additions & 1 deletion docs/components/data/35-o-table.component.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,48 @@ Include the table cell renderer currency in your table column by configuring the

<!-- Equivalent code -->

<o-table-column a ttr="BALANCE" title="BALANCE">
<o-table-column attr="BALANCE" title="BALANCE">
<o-table-cell-renderer-currency currency-symbol="€" currency-symbol-position="right" thousand-separator="." decimal-separator=","></o-table-cell-renderer-currency>
</o-table-column>
```

Also you can configure different currency symbols for each row by using the `currency-symbol-column` attribute. This attribute specifies the column name in your data that contains the currency symbol for each row.

```html
<o-table-column attr="BALANCE" title="BALANCE" type="currency" currency-symbol-column="currencyCode" currency-symbol-position="right"></o-table-column>

<!-- Equivalent code -->

<o-table-column attr="BALANCE" title="BALANCE">
<o-table-cell-renderer-currency currency-symbol-column="currencyCode" currency-symbol-position="right"></o-table-cell-renderer-currency>
</o-table-column>
```

The `currency-symbol-column` attribute supports nested properties using dot notation:

```html
<o-table-column attr="BALANCE" title="BALANCE" type="currency" currency-symbol-column="currency.symbol"></o-table-column>
```

**Example data structure:**
```javascript
{
BALANCE: 1500.50,
currencyCode: "€"
}

// Or with nested properties:
{
BALANCE: 1500.50,
currency: {
symbol: "€",
code: "EUR"
}
}
```

> **Note:** When `currency-symbol-column` is specified, it takes precedence over the `currency-symbol` attribute for each row where the column value is available.

**Date cell renderer**

You can include the table cell renderer date in your table column by configuring the attribute `type` in the column with the value **date** or adding the `o-table-cell-renderer-date` to the table column. You may want to set the displaying date format by configuring the `format` attribute. Check this and other attributes in the **API** section of this page.
Expand Down