Skip to content
Discussion options

You must be logged in to vote

I'd recommend serializing and string-interpolating the name_mapping like this:

name_mapping = {'Alice': 'a', 'Bob': 'b'}

ui.aggrid({
    'columnDefs': [{
        'field': 'name',
        'headerName': 'Name',
        'headerTooltip': 'Tooltip for Column Header',
        ':tooltipValueGetter': f'(params) => ({json.dumps(name_mapping)})[params.value]',
    }],
    'rowData': [
        {'name': 'Alice'},
        {'name': 'Bob'},
    ],
})

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@tz301
Comment options

@falkoschindler
Comment options

Answer selected by tz301
@tz301
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants