table icon indicating copy to clipboard operation
table copied to clipboard

how to sum of data in table in react js

Open khawarshehzad786 opened this issue 2 years ago • 3 comments

Describe the bug

image

Your minimal, reproducible example

vscode

Steps to reproduce

i am unable to resolve this problem

Expected behavior

i am unable to resolve this problem

How often does this bug happen?

Only once

Screenshots or Videos

No response

Platform

linux

react-table version

18.2.0

TypeScript version

4.9.5

Additional context

No response

Terms & Code of Conduct

  • [X] I agree to follow this project's Code of Conduct
  • [X] I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

khawarshehzad786 avatar Apr 11 '23 10:04 khawarshehzad786

I assume you have the data since you have shown it in the table. Calculate the sum of the amount using the data and show it in the ui.

Also, you can have a look at here

{
  accessorKey: 'accessor_key',
  footer: ({ table }) => table.getFilteredRowModel().rows.reduce((total, row) => total + row.getValue('accessor_key'), 0),
}```

talatkuyuk avatar Apr 25 '23 14:04 talatkuyuk

@talatkuyuk how do we use the built in aggregatorSum?

9mm avatar Jan 19 '24 17:01 9mm

@talatkuyuk how do we use the built in aggregatorSum?

I've got this same question. There's mention of several built-in functions.

aaronfulkerson avatar Aug 09 '24 19:08 aaronfulkerson