您好,您可以参考SheetChanged事件来实现这个需求:
- spread.bind(GC.Spread.Sheets.Events.SheetChanged, function (sender, args) {
- if (args.propertyName == "insertSheet") {
- let sheetName = args.sheetName;
- let sheet = spread.getSheetFromName(sheetName);
- /** Add Table To New Sheet */
- var sTable = sheet.tables.add(
- "table1",
- 1,
- 1,
- 10,
- 5,
- GC.Spread.Sheets.Tables.TableThemes.medium2
- );
- }
- });
复制代码 |