您好,我刚试了一下,效果没有明显提升,可能不是这里的问题。我再重新完整的描述一下:导入Excel会判断AB是否是指定设置的列(如经济指标),如果不是会插入2列并每个格子是选择控件,当切换sheet时会在spread.bind(GC.Spread.Sheets.Events.ActiveSheetChanged, this.activeSheetChanged); 这个事件中执行判断当前sheet表格是否需要添加AB列
- reanderABOptions() {
- var spread1 = this.designer.getWorkbook();
- spread1.suspendPaint();
- var sheet = this.designer.Spread.getActiveSheet();
- if ("yicharu" != sheet.tag()) {
- // 是否是首次打开sheet,是则插入2列,不是则不插入
- sheet.addColumns(0, 2);
- sheet.tag("yicharu");
- }
- let rowNum = sheet.getRowCount(GC.Spread.Sheets.SheetArea.viewport);
- sheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.colHeader).text("经济指标");
- sheet.getCell(0, 1, GC.Spread.Sheets.SheetArea.colHeader).text("技术指标");
- // 行内渲染
- let rowOptBox = this.domRowSelect(false, this.economicIndicators);
- let rowOptBox1 = this.domRowSelect(false, this.technicalIndicators);
- // for (let i = 0; i < rowNum; i++) {
- // sheet.setStyle(i, 0, rowOptBox);
- // sheet.setStyle(i, 1, rowOptBox1);
- // }
- sheet.setStyle(-1, 0, rowOptBox);
- sheet.setStyle(-1, 1, rowOptBox1);
- spread1.resumePaint();
- }
复制代码 |