reactgrid icon indicating copy to clipboard operation
reactgrid copied to clipboard

[question] How to get data from the computed cells?

Open KirillTerentiev opened this issue 3 years ago • 2 comments

Describe the bug I have calculate values from the row onto TOTAL VALUE cell, but can't get this calculated numbers from cell. Unfortunately there are no examples in DOCS or tutorials how to manage onChange event in computed cells

Current behavior Calculated number in cell don't stores anywhere

Expected behavior Wanted to have access to computed non editable cells f.e to store value in a state

KirillTerentiev avatar Aug 16 '22 13:08 KirillTerentiev

Here is an example of getting access to the calculated value being changed by the user and changing the state of the grid. If you want to change the state of the store, just intercept it in the applyChangesToRows function and pass that to the store.

https://codesandbox.io/s/reactgrid-calculated-cell-on-change-rsmzd8?file=/src/index.tsx:1080-1098

hunterwilhelm avatar Sep 07 '22 00:09 hunterwilhelm

Actually the idea behind ReactGrid is that you as the developer calculate the values and submit them as props to the grid. The grid is just a presentation layer (like html table) . So you should have access to the values while they are calculated.

MichaelMatejko avatar Sep 20 '22 12:09 MichaelMatejko

Hi @KirillTerentiev, please close this issue if the answers make sense :)

alonshmiel avatar May 30 '23 18:05 alonshmiel