Closed watchingfun closed 2 weeks ago
Hi @watchingfun
The spliceRow()
, as mentioned in the documentation at https://handsontable.com/docs/react-data-grid/api/core/#splicerow, is made for arrays (not objects).
Underneath it calls thepopulateFromArray
method https://github.com/handsontable/handsontable/blob/56d54d6e98da2b4d376829cb4077f4dea7b4a131/handsontable/src/dataMap/dataMap.js#L690C14-L690C31
so to add columns with data you'd need to alter the data object or change the columns
settings and then add data, for example with the setDataAtCell()
or setDataAtRowProp
.
Thank you for your answer. The problem was caused by my misunderstanding of the documentation, so I could add new rows via hot.alter('insert_row', hot.countRows());
and then set the row data via setDataAtRowProp
Describe the bug
When using a two-dimensional array, spliceRow is called normally, but when using an object array, an error is reported.
Is it true that spliceRow cannot be used when using object arrays? I see no explanation in the documentation.
Video/Screenshots
Provide a link to the demo with the bug reproduction
https://jsfiddle.net/qkhrdbo1/
Handsontable version
handsontable@14.3
Framework version
No response
Your environment
chrome