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
6 changes: 6 additions & 0 deletions _data/components/otableData/00table.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,12 @@ attributes: [{
description: "Indicates whether row selection is triggered when clicking on a row",
required: "",
default: "yes"
},{
name: "show-header-tooltip",
type: "yes|no|true|false",
description: "Indicates whether or not to show tooltip in the column headers",
required: "",
default: "no"
}]

inheritedOutputs: [{
Expand Down
16 changes: 16 additions & 0 deletions _data/components/otableData/01tableColumn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,20 @@ attributes: [{
type: "ErrorData[]",
default: "[]",
description: "Array of custom validators error information (synchronous or asynchronous). Each element must have a 'name' property corresponding to the validator error name and a 'text' property that will be displayed when the component value does not satisfy the validator condition"
},{
name: "header-tooltip",
type: "string",
since: "v15.9.0",
description: "Tooltip text shown when hovering over the column header. If `header-tooltip-icon` is also set, the tooltip is displayed on the icon instead of the header text"
},{
name: "header-tooltip-icon",
type: "string",
since: "v15.9.0",
description: "Material icon name rendered next to the header title. The tooltip defined in `header-tooltip` will be attached to this icon."
},{
name: "header-tooltip-class",
type: "string",
since: "v15.9.0",
default: "o-table-header-icon-tooltip",
description: "CSS class applied to the matTooltip in the column header. Useful for custom tooltip styling."
}]
26 changes: 18 additions & 8 deletions _data/components/otableData/types/OTableGlobalConfig.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
type: "OTableGlobalConfig"
description: "Represents the default options for the table that can be configured using the <a href='#O_TABLE_GLOBAL_CONFIG'>O_TABLE_GLOBAL_CONFIG</a> injection token.

<div class='language-html highlighter-rouge'>
<div class='language-html highlighter-rouge'>
<div class='highlight'>
<pre class='highlight'>
<code>
Expand All @@ -11,13 +10,17 @@ description: "Represents the default options for the table that can be configure
filterColumnActiveByDefault: boolean;
editionMode: OTableEditionMode;
detailMode: OTableDetailMode;
rowHeight: ORowHeight,
showChartsOnDemandOption: boolean;
rowHeight: ORowHeight;
selectionOnRowClick: boolean;
showChartOnDemandOption: boolean;
showReportOnDemandOption: boolean;
loading: { threshold: number, minVisible: number };
selectionOnRowClick?: boolean;
loading: {
threshold: number;
minVisibleRows: number;
};
horizontalScroll: boolean;
};
showHeaderTooltip: boolean;
};
</code>
</pre>
</div>
Expand Down Expand Up @@ -89,6 +92,13 @@ attributes: [{
default : "{threshold:300 , minVisibleRows: 300}",
required : "",
description : "Configuration object for loading strategy."
}
},
{
name: "showHeaderTooltip",
type: "boolean",
default : "false",
required : "",
description : "Indicates whether to show or not the tooltip on header cells."
}
]

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 92 additions & 0 deletions docs/components/data/35-o-table.component.md
Original file line number Diff line number Diff line change
Expand Up @@ -1338,6 +1338,98 @@ Table allows multiple columns sorting by default. Using the `multiple-sort` inpu

A column is sorted when user clicks on its header. If the multiple sorting is active the previously sorted columns keeps its state, otherwise the previously sorted column returns to its original state.

Aquí la propuesta del apartado nuevo para la documentación:

---

### Header tooltip

The `o-table` component provides several ways to configure tooltips on column headers, from global configuration to individual column customization.

**Basic usage**

Enable a tooltip for all column headers at once using the `show-header-tooltip` input on the table. This will display the column title as the tooltip text on hover.

```html
<o-table attr="customers" service="customers" entity="customer"
show-header-tooltip="yes">
<o-table-column attr="ID" title="ID"></o-table-column>
<o-table-column attr="NAME" title="Customer full name"></o-table-column>
<o-table-column attr="STATUS" title="Status"></o-table-column>
</o-table>
```

**Custom tooltip per column**

Use `header-tooltip` on each `o-table-column` to define a specific tooltip text, optionally combined with a Material icon using `header-tooltip-icon`.

```html
<o-table ..>

<!-- Tooltip displayed on an icon next to the title -->
<o-table-column attr="NOTES" title="Notes"
header-tooltip="Additional notes and comments related to the record"
header-tooltip-icon="info_outline">
</o-table-column>

</o-table>
```

![Header tooltip icon in o-table-column]({{ "/assets/images/components/tabla/header-tooltip-icon.png" | absolute_url }}){: .comp-example-img}

**Custom tooltip styling**

Use `header-tooltip-class` to apply a custom CSS class to the tooltip, allowing full control over its appearance.

```html
<o-table-column attr="NOTES" title="Notes"
header-tooltip="Additional notes and comments related to the record"
header-tooltip-icon="info_outline"
header-tooltip-class="my-custom-tooltip">
</o-table-column>
```

```scss
// styles.scss
.my-custom-tooltip {
background-color: #333;
color: #fff;
font-size: 13px;
max-width: 250px;
}
```

**Global configuration**

To apply `showHeaderTooltip` globally across all `o-table` instances in the application, use `O_TABLE_GLOBAL_CONFIG`:

```typescript
// app.module.ts
import { O_TABLE_GLOBAL_CONFIG } from 'ontimize-web-ngx';

@NgModule({
providers: [
{
provide: O_TABLE_GLOBAL_CONFIG,
useValue: {
showHeaderTooltip: true
}
}
]
})
export class AppModule { }
```

**Priority order**

When multiple tooltip configurations are present simultaneously, the following priority order applies — higher levels override lower ones:

```
1. header-tooltip (o-table-column level) ← highest priority
2. show-header-tooltip (o-table level)
3. showHeaderTooltip (OTableGlobalConfig) ← lowest priority
```

### Tooltip in columns

The `o-table` component provides a text that is displayed when the user hovers over an column.
Expand Down
Binary file added docs/components/data/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.