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
If you don't want to use the grid's tooltip component, you can use the enableBrowserTooltips config to use the browser's default tooltip. The grid will simply set an element's title attribute to display the tooltip.
Bookmark this question. Show activity on this post. tooltip A callback that takes (value, valueFormatted, data, node , colDef, rowIndex, and api) It must return the string used as a tooltip.
You need to use the tooltipValueGetter property and set this in defaultColDef to params. value . defaultColDef = { tooltipValueGetter: (params) => { return params. value; } };
ag-grid provides a way to get selected rows using api. getSelectedRows() function. And provides a way to set all rows using api. setRowData([]) function.
I use them like this in column definition:
{
field: 'fullAddress',
headerName: 'Address',
tooltip: (params) => 'Address: ' + params.value
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With