Column binding to data

Tags: #<Tag:0x00007f8b1ad0f438> #<Tag:0x00007f8b1ad0f2a8>

Hello!

I have a question. I will take this official example from the documentation:

What if my data looks like this:

const data = [
    { id: 1, name: { first: 'Ted', last:[ {name: 'Right'},{address: ''}] } }
    { id: 2, address: '' }, // Handsontable will create missing properties on demand
    { id: 3, name: { first: 'Joan', last: 'Well' }, address: '' }
  ];

How do I handle this case so that it still gets ‘Right’ inside the cell?

  } else if (column === 2) {
          columnMeta.data = 'name.last';
}

I have not found any example on this type of data structure, and nothing I tried seems to work.

Thank you!

Hi @vitorialipan

I can see that in your data set you have array of arrays nested inside array of objects. Handsontable wouldn’t understand such structure. If you want to have something similar, and group name and address under the last object you can do something like this: https://jsfiddle.net/handsoncode/qdsagj3f/

Oh, okay, so it doesn’t understand it, that’s why I didn’t see examples :slight_smile:

Thank you for your quick reply! You have been very helpful.

You’re welcome :slight_smile: I will close this topic now. In case you have any other questions, feel free to open a new one.