当前位置:网站首页>jspreadsheet/CE JExcel数据字段比给的字段(columns)多会导致空白列的问题解决方案
jspreadsheet/CE JExcel数据字段比给的字段(columns)多会导致空白列的问题解决方案
2022-06-30 15:47:00 【李彰德】
JExcel数据字段比给的字段(columns)多会导致空白列的问题
经过漫长的调试, 总结解决的结果
在jexcel.js文件的370行, 照下面这样注释掉就可以解决
原因是Object.keys(obj.options.data[0]).length会获取数据中key的个数, 并且在for循环中有添加obj.options.columns的动作, 所以会导致空白列(字段)的出现
/* // 这段代码会读取数据的key, 并返回个数, 接着会循环并添加到obj.options.columns
if (obj.options.data && typeof(obj.options.data[0]) !== 'undefined') {
// Data keys
var keys = Object.keys(obj.options.data[0]);
if (keys.length > size) {
size = keys.length;
}
}*/
// 下面会添加多的列, 因此注释掉上面的代码即可保持数据与字段一致
// Preparations
for (var i = 0; i < size; i++) {}边栏推荐
- 优惠券种类那么多,先区分清楚再薅羊毛!
- Cloud XR, how to help industrial upgrading
- 婴儿认知学习所带来的启发,也许是下一代无监督机器学习的关键
- 360 digital, ant group, etc. were selected as member units of the "business security promotion plan" of the Chinese Academy of Communications
- Open source STM32 USB-CAN project
- In depth analysis of the core code of the gadgetinspector
- Log4j2 advanced use
- I implement "stack" with C I
- 2022 Blue Bridge Cup group B -2022- (01 backpack to calculate the number of schemes)
- 猎头5万挖我去VC
猜你喜欢

Cesium-1.72 learning (deploy offline resources)

topic: Privacy, Deception and Device Abuse

Half year inventory of new consumption in 2022: the industry is cold, but these nine tracks still attract gold

ArcMap operation series: 80 plane to latitude and longitude 84

婴儿认知学习所带来的启发,也许是下一代无监督机器学习的关键

Google play index table

Li Zexiang, a legendary Chinese professor, is making unicorns in batches

新茶饮“死去活来”,供应商却“盆满钵满”?

居家办公浅谈远程协助快速提效心得 | 社区征文

Headhunter 50, 000, I'll go to VC
随机推荐
Interpretation of gaussdb's innovative features: partial result cache accelerates operators by caching intermediate results
[CVE-2019-0193] - Apache Solr DataImport 远程命令执行分析
MicroBlaze serial port learning · 2
Installing jupyter notebook under Anaconda
云和恩墨中标天津滨海农村商业银行2022-2023年度Oracle维保项目
抖快B为啥做不好综艺
2022蓝桥杯国赛B组-2022-(01背包求方案数)
有意思的鼠标指针交互探究
【Verilog基础】十进制负数的八进制、十六进制表示
Carry two load balancing notes and find them in the future
Headhunter 50, 000, I'll go to VC
【Unity UGUI】ScrollRect 动态缩放格子大小,自动定位到中间的格子
What is the difference between real-time rendering and pre rendering
Policy Center > Google Play‘s Target API Level Policy
Tencent two sides: @bean and @component are used on the same class. What happens?
云技能提升好伙伴,亚马逊云师兄今天正式营业
Cesium-1.72 learning (add points, lines, cubes, etc.)
halcon知识:矩阵专题【02】
药品管理系统加数据库,一夜做完,加报告
Bidding announcement: Tianjin housing provident fund management center database all-in-one machine and database software project (budget: 6.45 million)