您好,请参考以下代码:
- var spread = GC.Spread.Sheets.findControl("ss");
- var sheet = spread.getActiveSheet();
- var fbar = $("#formulaBar").find(".gcsj-func-color-text");
- sheet.bind(GC.Spread.Sheets.Events.EditorStatusChanged,function(e,args){
- if(args.oldStatus === 2 && args.newStatus === 0){
- var sheet = args.sheet;
- var status = args.newStatus;
- var row = sheet.getActiveRowIndex();
- var col = sheet.getActiveColumnIndex();
- sheet.setValue(row, col, fbar.text());
- }
- });
复制代码 |