Skip to content

Commit

Permalink
Fix set cell value to handle both formulas and numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
robertleeplummerjr committed Jul 18, 2014
1 parent b10ba5c commit cc20c91
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions jquery.sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,10 +740,16 @@ jQuery = jQuery || window.jQuery;
&& (cell = jS.getCell(rowIndex, colIndex, sheetIndex))
) {
try {
cell.value = value;
cell.valueOverride = cell.formula = '';
if ((value + '').charAt(0) == '=') {
cell.valueOverride = cell.value = '';
cell.formula = value.substring(1);
} else {
cell.value = value;
cell.valueOverride = cell.formula = '';
}
cell.calcLast = cell.calcDependenciesLast = 0;
jS.updateCellValue(sheetIndex, rowIndex, colIndex);
jS.updateCellValue.call(cell);
jS.updateCellDependencies.call(cell);
return true;
} catch (e) {}
}
Expand Down

0 comments on commit cc20c91

Please sign in to comment.