How to use an array of array of objects as data source?

Tags: #<Tag:0x00007f0b09168558>

Hello team!

I am using a data source where every cell is an object.

let data = [
  [{}, {}, {}],
  [{}, {}, {}],
];

Every cell is an object containing the user input as well a resolved expression, which is resolved at a specific time and then cached.

These are both valid objects in my data source:

{ value: '=10+3', resolvedValue: null }
{ value: '=10+3', resolvedValue: 13 }

I wrote a custom renderer which displays resolvedValue if available else value.
The issue is when a user edits the cell. I am not able to show value, but it appears [object Object].
I am not able to select the object property with cells function.

Is there any way to achieve what I want?
Have I to produce a simple array of array of primitive values from my data source?
Should I write a custom Editor?

Thank you very much for the help!

Hey @ccrnn

Handsontable does not understand more than 2 levels of nesting, you can either have an array of arrays or array of objects. You have used the custom renderer, which is great (that’s the way to overcome this obstacle) when it comes to rendering. However you’d need to create a custom editor to get the single (not object) value for a single cell while editing.

Thanks for the help.
I will look into creating a custom editor.

1 Like