Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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"
}
3 changes: 2 additions & 1 deletion packages/vtable/src/ListTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand Down
Loading