Ray
Posted on June 7, 2024
Question title
How to set up multi-level headers
Problem description
How to configure headers to achieve multi-level header grouping effect
Solution
In the column
configuration in VTable, it supports specifying the subordinate table header of the column through the columns
configuration, and this rule can be used for multi-level nesting
Code example
const columns = [
{
field: 'id',
title: 'ID',
width: 100
},
{
title: 'Name',
columns: [
{
field: 'name1',
title: 'name1',
width: 100
},
{
title: 'name-level-2',
width: 150,
columns: [
{
field: 'name2',
title: 'name2',
width: 100
},
{
title: 'name3',
field: 'name3',
width: 150
}
]
}
]
}
];
const option = {
records,
columns,
// ......
};
Results show
Complete example: https://www.visactor.io/vtable/demo/basic-functionality/list-table-header-group
Related Documents
Related api: https://www.visactor.io/vtable/option/ListTable-columns-text#columns
💖 💪 🙅 🚩
Ray
Posted on June 7, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
visactor How to manually update the state when using the Checkbox in the VTable component?
June 14, 2024
visactor How to implement dimension drill-down function when using VTable pivot table component?
June 14, 2024