Skip to content

[Bug] 列很多时,有左右固定列, 横向滚动条滚动到最右边, 此时setRecords, 表头出现空白 #5278

Description

@zhiaiing

Version

1.26.6

Link to Minimal Reproduction

https://visactor.io/vtable/demo/table-type/list-table?version=1.26.6

Steps to Reproduce

let tableInstance;
fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/North_American_Superstore_data.json')
.then(res => res.json())
.then(data => {
const columns = [
{
field: 'Order ID',
title: 'Order ID',
width: 'auto'
},
{
field: 'Customer ID',
title: 'Customer ID',
width: 'auto'
},
{
field: 'Product Name',
title: 'Product Name',
width: 'auto'
},
{
field: 'Category',
title: 'Category',
width: 'auto'
},
{
field: 'Sub-Category',
title: 'Sub-Category',
width: 'auto'
},
{
field: 'Region',
title: 'Region',
width: 'auto'
},
{
field: 'City',
title: 'City',
width: 'auto'
},
{
field: 'Order Date',
title: 'Order Date',
width: 'auto'
},
{
field: 'Quantity',
title: 'Quantity',
width: 'auto'
},
{
field: 'Sales',
title: 'Sales',
width: 'auto'
},
{
field: 'Profit',
title: 'Profit',
width: 'auto'
}
];

for (let i = 0; i < 300; i++) {
  columns.push({
    
    field: 'Sales' + i,
    title: 'Sales' + i,
    width: '120'
  
  })

}

const option = {
  records: data.splice(0, 6),
  frozenRowCount: 3,
  bottomFrozenRowCount: 1,
  frozenColCount: 2,
  rightFrozenColCount: 2,
  columns,
  widthMode: 'standard',
  rowSeriesNumber: {
    width: 50,
    format: () => {
      return '';
    },
    cellType: 'checkbox',
    headerType: 'checkbox'
  },
};
tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), option);
window['tableInstance'] = tableInstance;

});

body 滚动到最右侧

调用 window['tableInstance'].setRecords([])

Current Behavior

Image

Expected Behavior

表头正常展示

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions