VTable
VTable copied to clipboard
[BUG] 透视表,自定义columnTree表头之后,点击指标不能排序
https://www.visactor.io/vtable/guide/data_analysis/pivot_table_dataAnalysis 看教程
看了好几遍,没看懂啊,能给条明路不
为啥,下面的配置就能正常排序
let tableInstance;
fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/North_American_Superstore_Pivot_Chart_data.json')
.then(res => res.json())
.then(data => {
const option = {
records: data,
rows: [
{
dimensionKey: 'Category',
title: 'Category',
sort: true
},
{
dimensionKey: 'Sub-Category',
title: 'Sub-Catogery',
sort: true
}
],
columns: ['Region', 'Segment'],
indicators: [
{
indicatorKey: 'Sales',
title: 'Sales',
sort: true,
},
{
indicatorKey: 'Profit',
title: 'Profit',
sort: true,
}
],
corner: {
titleOnDimension: 'row',
headerStyle: {
textStick: true
}
},
defaultColWidth: 130
};
tableInstance = new VTable.PivotTable(document.getElementById(CONTAINER_ID), option);
window['tableInstance'] = tableInstance;
});
更新,经测试发现
- columnHierarchyType: 'grid-tree' 时无法排序,
- 自定义columnTree的时候,无法排序