Using Calculate Formula Reactively #1152
BrianHung
started this conversation in
API Questions
Replies: 1 comment 2 replies
-
Hi @BrianHung, thanks for reaching out! I think the best approach to this problem would be to define a named expression and use the valuesUpdated event to listen for changes in the named expression value. demo: https://stackblitz.com/edit/js-4kvpek?file=index.html,index.js |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to use
calculateFormula
reactively?For example, I want to build a selection summary that applies a formula like
SUM
across all cells in a selection range. I can convert that selection range to useA1
notation, e.g.=SUM(A1:D10)
.But am wondering how to update that result whenever any value within
A1:D10
changes. In this context, I sort of want the normal reactivity as if=SUM(Grid1!A1:D10)
was a cell but not have hack it into a sheet.The ideal DX I'm looking for is something like this so I can agnostically integrate it into React.
I have tried looking at handsontable's
ColumnSummary
plugin as inspiration, and it feels close?Just need a utility function to parse a generic formula for all of its cell dependents, then check if changes from the
valuesUpdated
listener intersect the dependents.Beta Was this translation helpful? Give feedback.
All reactions