您好,请参考以下代码:
sheet.bind(GC.Spread.Sheets.Events.EditEnded, function (sender, args) {
console.log(sender);
let columns = [{ col: args.col }];
spread.options.allowUndo = true;
spread.commandManager().execute({
cmd: "autoFitColumn",
sheetName: args.sheetName,
columns: columns,
isRowHeader: false,
autoFitType: GC.Spread.Sheets.AutoFitType.cell,
});
});
|