Issue with data display

Tags: #<Tag:0x00007f8b2919fa08>

Hello Team,

I have this following data to be displayed in handsontable:

{DevDescId: "1", DevDesc: "Testing Dev"}

{CaDescId: "1.1", CaDesc: "Testing Child 1 of Dev"}

{CaDescId: "1.2", CaDesc: "Testing Child 1 of Dev"}

{ConDescId: "1.1.1", ConDesc: "Testing Child 1 of Ca"}

{SaDescId: "1.1.1.1", SaDesc: "Testing Child  1 of Con"}

At present handsontable is created missing properties on demand and displaying the data as step down format. Screenshot attached.

Is it possible to place the data in the same level as DevDescId and DevDesc?

Hi @vanivkulkarni

Handsontable uses your key structure to create a table. You have different keys for the last two rows. As it did not find the CaDesc for the 4th row it pushes a new key to a new column.

If you do not want to change the object keys you can use setDataAtCell method like so http://jsfiddle.net/6tL3hjbg/

Hi @aleksandra_budnik,

I know we can do it by using setDataAtCell, but my data is coming from the db and I need to bind it to handsontable. So was thinking if it allowed default binding on the same level.

Sorry, there is no easy way to change it. The quickest way would be (If the array of objects is long) is to convert it to an array of arrays.

ok, is there any example where I can refer to which illustrates array of arrays in handsontable?

Hi @vanivkulkarni
here https://stackoverflow.com/questions/38824349/convert-object-to-array-in-javascript/44790922 I found an example of converting an object to an array, That may help.