Comments (2)
你最好用事件sort_click
。
给透视维度表的指标设置sort: true,显示排序图标但是实际排序不生效,
这个是怎么配置的呢 可以复现吗 @blngblng
from vtable.
后面改成sort_click了,给透视维度表的指标设置sort: true,显示排序图标但是实际排序不生效的例子大概是下面这样,行头的生效的,但是指标不生效。我在这里补充了提问。 @fangsmile
#2278
示例代码
`
let tableInstance;
const data = [
{row1:'2024-08-01', row2:'周六', Quantity1:'1', Sales1:'4', Quantity2:'2', Sales2:'2'},
{row1:'2024-08-03', row2:'周四', Quantity1:'2', Sales1:'3', Quantity2:'2', Sales2:'2'},
{row1:'2024-08-07', row2:'周三', Quantity1:'3', Sales1:'2', Quantity2:'2', Sales2:'2'},
{row1:'2024-08-09', row2:'周二', Quantity1:'4', Sales1:'1', Quantity2:'2', Sales2:'2'},
]
const option = {
records: data,
rows: [
{
dimensionKey: 'row1',
title: '日期',
sort: true,
headerStyle: {
textStick: true
},
width: 'auto'
},
{
dimensionKey: 'row2',
title: '星期',
sort: true,
headerStyle: {
textStick: true
},
width: 'auto'
}
],
columns: [
{
dimensionKey: 'data',
title: '销售情况',
headerStyle: {
textStick: true
},
width: 'auto'
},
],
columnTree: [
{
dimensionKey: 'data',
value: '商品1',
virtual: true,
children:[
{indicatorKey: 'Quantity1',},
{indicatorKey: 'Sales1',},
],
width: 'auto'
},
{
dimensionKey: 'data',
value: '商品2',
virtual: true,
children:[
{indicatorKey: 'Quantity2',},
{indicatorKey: 'Sales2',},
],
width: 'auto'
},
],
indicators: [
{
indicatorKey: 'Quantity1',
title: 'Quantity1',
width: 'auto',
headerStyle: {
fontWeight: 'normal'
},
sort:true
},
{
indicatorKey: 'Sales1',
title: 'Sales1',
width: 'auto',
headerStyle: {
fontWeight: 'normal'
},
format: rec => {
return '$' + Number(rec).toFixed(2);
},
sort:true
},
{
indicatorKey: 'Quantity2',
title: 'Quantity2',
width: 'auto',
headerStyle: {
fontWeight: 'normal'
},
},
{
indicatorKey: 'Sales2',
title: 'Sales2',
width: 'auto',
headerStyle: {
fontWeight: 'normal'
},
format: rec => {
return '$' + Number(rec).toFixed(2);
},
},
],
corner: {
titleOnDimension: 'all',
headerStyle: {
textStick: true
}
},
dataConfig: {
},
widthMode: 'standard'
};
tableInstance = new VTable.PivotTable(document.getElementById(CONTAINER_ID), option);
window['tableInstance'] = tableInstance;
`
from vtable.
Related Issues (20)
- [Feature] 支持滚动动画
- [Feature] 高亮关联行号
- [Feature] 支持选中/复制表格主体
- [Bug]开启快捷键粘贴: ListTable.keyboardOptions.pasteValueToCell,column没有配置editor也能粘贴
- [Bug] when config bottomFrozenRowCount call updateRow error
- 文档中没有体现多行托拽,有这个功能吗? HOT 1
- 性能问题,透视表滚动条拖拽卡顿 HOT 1
- [Feature] updateRecords API得效率很低,存在性能问题,希望能优化一下updateRecord HOT 2
- [Bug] updatePivotSortState在指标处的排序状态改变不生效(sort同样)
- [Bug] isAggregation ListTableAPI没声明TS HOT 1
- [Bug] 在图元中设置poptip的部分配置无效 HOT 2
- [Bug] 在文本图元中的部分配置无效 HOT 2
- PivotTable没有数据时表头宽度展示不正常,宽度设置了auto,没有自动撑开,表头出现了溢出隐藏效果
- [Bug] 自定义组件拖宽列宽时,单元格频繁闪烁
- [Bug] 指标设置在行上显示并且开启指标排序,被冻结的行不显示排序图表
- [Bug] 拖动行顺序行内的单选框、复选框属性不会同步移动,getCellRadioState方法无法获取到值
- [Bug] 使用updateColumns方法更新字段配置后底部聚合栏会变成空白(官例复现),这个表格BUG太多了,我只简单的使用都找出好几个BUG了,哎 HOT 1
- [Bug] custom-style的例子链接失效https://www.visactor.io/vtable/guide/demo/custom-render/custom-style
- [Bug] 框选带有合并单元格的情况下,调用删除方法会删除不干净,复制合并单元格的情况下粘贴会粘贴不全
- [Bug] 普通表通过aggregation列求和的时候 结果应该是直接用了js的加法计算,出现了计算的结果会有无限循环的9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vtable.