Wanted to implement formula in array of objects or columns attribute(in react ) or property in options

Tags: #<Tag:0x00007f8b2b03b020>

Hi ,

For implementing formula in hot, i referred the below link
https://handsontable.com/docs/7.0.2/demo-formula-support.html

But the example in this demonstrates using array of arrays. What if i have used createEmptySpreadsheetData() function to create a blank spreadsheet and want to use formula in array of objects instead of array of arrays?

Thank you.

I implemented it like this

var
objectData = [
{id: 1, name: ‘=SUM(A1,A1)’, address: ‘’},
{id: 2, name: ‘Frank Honest’, address: ‘’},
{id: 3, name: ‘Joan Well’, address: ‘’},
{id: 4, name: ‘Gail Polite’, address: ‘’},
{id: 5, name: ‘Michael Fair’, address: ‘’},
],
container3 = document.getElementById(‘example3’),
hot3;

hot3 = new Handsontable(container3, {
data: objectData,
colHeaders: true,
minSpareRows: 1,
columns: [
{data: “id”},
{data: “name”, type :“numeric” , readOnly:true}
],
formulas:true
});

Thanks. :smile:

Hey @nishant95k

If you’d need help with anything else please let me know.