I inherited a project that uses a couple of handsontables. I was tasked with adding more columns to one of them and noticed that when I save my handsontable via html button click, if the last column still has focus, it doesn’t get read in by my GetData() method.
Here’s my method:
function GetData() {
debugger;
TableData2 = new Array();
strJSON = "";
var rowCount2 = hot2.countRows();
var id = '@reportId';
for (i = 0; i < rowCount2; i++) {
var Lot = hot2.getDataAtCell(i, 0);
var Product = hot2.getDataAtCell(i, 1);
var Customer = hot2.getDataAtCell(i, 2);
var Qty = hot2.getDataAtCell(i, 3);
var Scrap = hot2.getDataAtCell(i, 4);
var HoldRequired = hot2.getDataAtCell(i, 5);
var Location = hot2.getDataAtCell(i, 6);
var Operation = hot2.getDataAtCell(i, 7);
var Recipe = hot2.getDataAtCell(i, 8);
var SpecialRecipe = hot2.getDataAtCell(i, 9);
TableData2[i] = { 'id': id, 'LotId': Lot, 'ProductCode': Product, 'Customer': Customer, 'Qty': Qty, 'Scrap': Scrap, 'HoldRequired': HoldRequired, 'Location': Location, 'Operation': Operation, 'Recipe': Recipe, 'SpecialRecipe': SpecialRecipe };
}
return TableData2;
}
Can you tell me how to resolve this issue?