How can I save cell properties to localStorage?

Tags: #<Tag:0x00007f343c5fb280>


I would like to save all cell properties via getCellMeta to localStorage but I get a following error:
Uncaught TypeError: Converting circular structure to JSON

I used a following code:

for (var row = 0; row < ROWS; row++) {
  for (var col = 0; col < COLS; col++) {
    currentSheetProperties[row][col] = hot.getCellMeta(row, col);
// save array
localStorage["properties"] = JSON.stringify(currentSheetProperties);

In the last source code row I got that error. Demo


Hi @jan.zitniak

As mentioned here you’re passing something that holds the reference. The cellmeta for a single cell holds the reference to the instance of Handsontable

You should, however, be able to save the cellmeta while skipping the instance.