您好,经调研,这是因为您将spread.options.pasteSkipInvisibleRange设置为了true,将会使粘贴时忽略不可见列。
您可以参考以下代码来修改:
- function addRowCopy(spread, rows) {
- let sheet = spread.getActiveSheet();
- let row = sheet.getActiveRowIndex();
- let colCount = sheet.getColumnCount();
- spread.options.pasteSkipInvisibleRange = false;
- console.log(
- "addRowCopy => colCount:",
- colCount,
- GC.Spread.Sheets.CopyToOptions.all
- );
- sheet.addRows(row, rows);
- for (let i = row; i < row + rows; i++) {
- sheet.copyTo(row + rows, 0, i, 0, 1, colCount, 2046);
- }
- spread.options.pasteSkipInvisibleRange = true;
- }
复制代码 |