Is there a way to handle Workbook data with useState? (有没有办法用useState处理工作簿数据?) #2310
Unanswered
IchiharaGaku
asked this question in
Q&A | 常见问题
Replies: 1 comment 1 reply
-
Univer has designed a command system. In principle, any data changes should be executed through the command system. Failure to do so may lead to unexpected results. For more details, please refer to: https://univer.ai/guides/sheet/architecture/univer#command-system |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to render data on UniverSheet and trigger a function in the codebase that performs numerical calculations automatically when the user edits the data. The calculations involve arithmetic operations, such as summing the numbers between certain specified text values.
Additionally, since the data varies every time, using the SUM function with fixed cell references is not feasible.
Therefore, I would like to retrieve the data each time the user edits it on the sheet, similar to an onChange event.
Moreover, I want to ensure that these calculations are maintained even when the user adds or deletes rows.
If there is a better way to manage this other than using useState, please let me know. 🙏
===========
我想在UniverSheet上渲染数据,并在用户编辑数据时触发代码中的函数,该函数会自动执行数值计算。这些计算涉及算术运算,例如将某些指定文本值之间的数字相加。
此外,由于数据每次都会变化,使用固定单元格引用的SUM函数是不可行的。
因此,我希望每次用户在表格上编辑数据时都能获取数据,类似于onChange事件。
而且,我希望确保即使用户添加或删除行,这些计算也能保持不变。
如果有比使用useState更好的管理方法,请告诉我。
Beta Was this translation helpful? Give feedback.
All reactions