grid.cells is detecting 1 less row count than grid.getRowsNum.
Using a for loop to traverse all the rows in a grid:
for (var i = 1; i <= grid.getRowsNum(); ++i) {
cellText = grid.cells(i,0).getValue(); // this function breaks!!!
}
getRowsNum returns a value 1 higher than grid.cells(i,0) accepts as are in the grid.
This occurs after the grid has been displayed, All rows selected, All rows deleted, All rows re-added using:
grid.selectAll();
grid.deleteSelectedRows();
for (var i = 0; i < choiceArray.length; ++i) {
grid.addRow(i+1,choiceArray[i],i+1);
}
What is the solution? I need getRowsNum to return a value that I can use in grid.cells.