How to create tooltip on ag-grid row?

Sandeep Kumar picture Sandeep Kumar · Jun 29, 2018 · Viewed 18.5k times · Source

I want to display a tooltip conditionally based on status field, on hovering over an entire row(not on just cells). In the API documentation, I found this: https://www.ag-grid.com/javascript-grid-column-properties/

tooltip A callback that takes (value, valueFormatted, data, node , colDef, rowIndex, and api) It must return the string used as a tooltip. tooltipField takes precedence.

Can this be used to display a tooltip on an entire row? If yes, could anyone provide any working example? If not, is there any other way I can achieve it?

Thanks

Answer

Quad Coders picture Quad Coders · Aug 10, 2018

I use them like this in column definition:

{
    field: 'fullAddress',
    headerName: 'Address',
    tooltip: (params) => 'Address: ' + params.value
}