Skip to content

How to Properly Use aggregationFn in Dash Mantine React Table Columns? #7

@leodrvs

Description

@leodrvs

Hello!

I’m trying to use aggregationFn in my column definitions to display aggregated values when grouping rows, but the summed values don’t appear as expected. Here’s my current setup:

columnDefs = [
{"accessorKey": "region", "header": "region"},
{"accessorKey": "id_item", "header": "id_item"},
{"accessorKey": "id_doc", "header": "id_doc", "enableGrouping": False},
{"accessorKey": "revenue", "header": "revenue", "aggregationFn": "sum"},
]

grid = dmc.Box(DashMantineReactTable(
data=data,
columns=columnDefs,
mrtProps={
"enablePagination": False,
"enableRowVirtualization": True,
"enableColumnResizing": True,
"enableGrouping": True,
}
), mt='md')

Could you please guide me on the correct way to implement aggregationFn so that grouped rows display the sum (or other aggregations) properly?

Thank you in advance for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions