How to add tooltip on aggrid row? #2812
-
QuestionFrom https://ag-grid.com/javascript-data-grid/tooltips/ , I can set tooltip using ui.aggrid(
{
'columnDefs': [{'field': 'name', 'headerName': 'Name', 'headerTooltip': 'Tooltip for Column Header'}],
'rowData': [{'name': 'Alice'}, {'name': 'Bob'}],
}
) |
Beta Was this translation helpful? Give feedback.
Answered by
falkoschindler
Apr 3, 2024
Replies: 1 comment 3 replies
-
Hi @tz301, The "tooltipValueGetter" field needs to be a function. We can't instantiate JavaScript functions in Python, but we can send the function as a string. To indicate that the string needs to be converted back to a JavaScript instance, we use a colon ":" prefix: ui.aggrid({
'columnDefs': [{
'field': 'name',
'headerName': 'Name',
'headerTooltip': 'Tooltip for Column Header',
':tooltipValueGetter': '(params) => params.value.toUpperCase()',
}],
'rowData': [
{'name': 'Alice'},
{'name': 'Bob'},
],
}) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'd recommend serializing and string-interpolating the
name_mapping
like this: