react-spreadsheet | Spreadsheet like a reactJS component | Grid library
kandi X-RAY | react-spreadsheet Summary
kandi X-RAY | react-spreadsheet Summary
The goal of this project is to build an online spreadsheet. It is a 40x40 grid with editable cells. Cells adapt to the data entered by the user. When clicking a cell, the background of the cell turns blue, indicating it has been selected. Double click turns the background orange, indicating it can be edited. Cell editing allows the user to enter numeric values or strings, as well as formulas. Formulas must have the following format: =(row number, column number) {op} (row number, column number)…. Editing ends when clicking any different cell. For formulas, the grid shows "Formula result".
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of react-spreadsheet
react-spreadsheet Key Features
react-spreadsheet Examples and Code Snippets
Community Discussions
Trending Discussions on react-spreadsheet
QUESTION
I use a react module that manages the use of spreadsheets: react-spreadsheet https://github.com/iddan/react-spreadsheet/
In my project, I need several spreadsheets, and therefore several tables that the user can add, modify, delete on the fly
At the beginning, I wanted to use a big useState variable where the data arrays would be concentrated in the form : stateData = [ [...arrays], [...arrays...] ]
But the module, which uses an OnChange function taking as value the setData, seems to bug when my stateData variable contains different arrays.
...ANSWER
Answered 2021-Dec-07 at 00:05Seeing your code and your comment, I'm assuming that:
- You have one
useState
nameddata
with ALL your data in it - You have multiple spreadsheets
- For each spreadsheet, you want to pass the
sheetData
and theonChange
that updates it
The issue in your code is that you're setting onChange={setData}
, meaning any change will override the WHOLE data object, not just the targeted index.
What you want to do is have your onChange
function be a function that updates only the right part of your state. So you'd do it like so:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install react-spreadsheet
npm 1.4
grunt 0.4
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page