I have this Material-UI DataGrid, how can I sum all of the values for the column Total Amount in which this will also be updated once filter is triggerd as well?
I am really unsure on how I can sum the entire column of total amount. Any help would be appreciated. Thank you
Codes:
const [filterModel, setFilterModel] = React.useState({
items: [
{
columnField: "totalAmount",
operatorValue: ">",
value: "200"
}
]
});
return (
<div style={{ height: 400, width: "100%" }}>
<DataGrid
// rows={rows}
columns={columns}
rows={data}
components={{
Toolbar: GridToolbar
}}
filterModel={filterModel}
onFilterModelChange={(newFilterModel) => setFilterModel(newFilterModel)}
/>
</div>
);
}