Posted 16 August 2022, 3:19 am EST
Hi,
“EditChange” Event is trigged when the cell is in edit mode and the text is changed. When you are setting the value of the cell using the setValue() method, it does change the value of the cell. You can verify it by logging the value of the cell:
sheet.bind(GC.Spread.Sheets.Events.EditChange, function (sender, args) {
let { sheet, row, col, editingText } = args;
sheet.setValue(row, col, "12.00", GC.Spread.Sheets.SheetArea.viewport);
console.log(sheet.getValue(row, col));
});
However, when the editing of the cell is complete, the cell value will the text that is inside the editing element. You can set the value of the cell after the editing of the cell ended by using the EditEnded Event.
sheet.bind(GC.Spread.Sheets.Events.EditEnded, function (sender, args) {
console.log("Edit Ended");
sheet.setValue(args.row, args.col, "12.00", GC.Spread.Sheets.SheetArea.viewport);
});
Sample: https://jscodemine.grapecity.com/share/P-rNDCGu3Eigf4Gben7dpw/
API Reference(s):
EditEnded Event: https://www.grapecity.com/spreadjs/docs/latest/online/SpreadJS~GC.Spread.Sheets.Events~EditEnded_EV.html
Regards
Ankit