From b732add3e3c1ba33df63c3e627ccd14d02b1d187 Mon Sep 17 00:00:00 2001 From: fangsmile <892739385@qq.com> Date: Wed, 23 Apr 2025 20:19:07 +0800 Subject: [PATCH 1/2] fix: when records is blank updateColumns api occor error #3766 --- packages/vtable/src/ListTable.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/vtable/src/ListTable.ts b/packages/vtable/src/ListTable.ts index 10535e0417..2826d04a31 100644 --- a/packages/vtable/src/ListTable.ts +++ b/packages/vtable/src/ListTable.ts @@ -213,6 +213,7 @@ export class ListTable extends BaseTable implements ListTableAPI { * Sets the define of the column. */ updateColumns(columns: ColumnsDefine) { + this.scenegraph.clearCells(); //将该代码提前 逻辑中有设置this.clear=true。refreshHeader逻辑中有判断clear这个值的地方 const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row }; this.internalProps.columns = cloneDeepSpec(columns, ['children']); generateAggregationForColumn(this); @@ -230,7 +231,7 @@ export class ListTable extends BaseTable implements ListTableAPI { this.dataSource.processRecords(this.dataSource.dataSourceObj?.records ?? this.dataSource.dataSourceObj); } this.internalProps.useOneRowHeightFillAll = false; - this.scenegraph.clearCells(); + this.headerStyleCache = new Map(); this.bodyStyleCache = new Map(); this.bodyBottomStyleCache = new Map(); From 37e5a0563159c17c92080ce1ee68bc8e56652b99 Mon Sep 17 00:00:00 2001 From: fangsmile <892739385@qq.com> Date: Wed, 23 Apr 2025 20:19:45 +0800 Subject: [PATCH 2/2] docs: update changlog of rush --- ...6-bug-row-frozen-occor-error_2025-04-23-12-19.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/changes/@visactor/vtable/3766-bug-row-frozen-occor-error_2025-04-23-12-19.json diff --git a/common/changes/@visactor/vtable/3766-bug-row-frozen-occor-error_2025-04-23-12-19.json b/common/changes/@visactor/vtable/3766-bug-row-frozen-occor-error_2025-04-23-12-19.json new file mode 100644 index 0000000000..bc06090d6b --- /dev/null +++ b/common/changes/@visactor/vtable/3766-bug-row-frozen-occor-error_2025-04-23-12-19.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: when records is blank updateColumns api occor error #3766\n\n", + "type": "none", + "packageName": "@visactor/vtable" + } + ], + "packageName": "@visactor/vtable", + "email": "892739385@qq.com" +} \ No newline at end of file