您好,可以用EditEnding事件来实现,参考如下代码:
- var spread = GC.Spread.Sheets.findControl("ss");
- var sheet = spread.getActiveSheet();
- sheet.bind(GC.Spread.Sheets.Events.EditEnding, function (sender, args) {
- console.log(args);
- console.log(args.sheet.getValue(args.row, args.col));
- var sheet = args.sheet;
- var row = args.row;
- var col = args.col;
- var oldValue = sheet.getValue(row, col);
- var newValue = args.editingText;
- if(newValue !== '在线 Excel 编辑器'){
- sheet.suspendPaint();
- setTimeout(function(){
- sheet.setValue(row, col, oldValue);
- sheet.resumePaint();
- }, 10);
- }
- });
复制代码 |