I have a handsontable and I am trying to display the Json data on handsontable. Below is the code. Problem that I am having with is, if add the column property of the handsontable, it will not display the Json data on handsontable but if I remove it, it works perfectly fine.
$(document).ready(function () {
objectData = [{ id: "dd1", name: 'bb' }, { id: "dd2", name: 'dd' }];
// objectData = [["aa", "bb"], ["cc", "dd"]];
var $container = $("#example");
$container.handsontable({
data:objectData,
rowHeaders: true,
colHeaders: true,
columns:[ {type: 'text'}, { type: 'text' }],
});
});
I have not got any error message but it is not populating the handsontable with JSon data(objectData). Also if I ignore this part and try enter the values on cell and get those for later saving into db, values I am getting is combined values of default value which is objectData and the value I entered on cells.