Keep reading and coding.
🇨🇳 Guangzhou China・🚀 Fullstack Engineer
https://bootstrap-table.com/docs/extensions/fixed-columns/
License: MIT License
Keep reading and coding.
🇨🇳 Guangzhou China・🚀 Fullstack Engineer
set fixed columns other column width % It doesn't work.
Hi, wenzhixin.
Thanks for new Plugin. It is exactly what i need.
But sort under fixed columns does not work.
http://issues.wenzhixin.net.cn/bootstrap-table/#extensions/fixed-columns.html
现有框架已将bootstrap-table插件整合到其中 ,为支持固定列,还需将bootstrap-table-fixed-columns插件整合到现有框架中。但是不确定bootstrap-table-fixed-columns插件依赖的bootstrap-table版本,或者说bootstrap-table-fixed-columns插件依赖bootstrap-table的最小版本是多少?
As the title is the problem.
bower ENOTFOUND Package bootstrap-table-fixed-columns not found
1、冻结列在ie下有兼容
2、会出现重复的表头
3、冻结列之后,左面的列高和右面的列高不一样
我发现要使用这个扩展,必须设置 data-height
,而我需要自适应高度;
自适应高度的话,会发现fixed-table-body-columns
这层div的heigth
和top
都不正确,请问我能在初始化后设置heigth
和top
这个样式吗?
不然没办法用了。
在实际的项目使用中发现作者这个插件 存在很多问题 样式错乱 对不齐 固定列后 固定列的样式不能应用表格的样式 什么滚动条被挡住 等等
特别是复杂表格头和有自定义样式的时候 这个插件乱的一团糟 我看这里下面反馈这个插件有问题的不是一个两个
望作者 修复
我是用chrome測試的。
http://jsfiddle.net/wenyi/e3nk137y/2954/
在這個sample裡,你把window resize一下,然後veritical scrolling時,fixed column都不會跟隨移動。
When we use bootstrap-table-fixed-columns, with columns declared dynamically, we can't know in advance how much columns we will have.
https://github.com/wenzhixin/bootstrap-table-fixed-columns/blob/master/bootstrap-table-fixed-columns.js#L135
Then, with those assertions this line is a problem because when we have the plugin activated, with too few columns, the table height is substracted by -14 with no reason (we have no horizontal-scroll).
The solution is :
How can we check if the scroll is up ?
I have a use case where I have multiple rows of header cells, but this plugin incorrectly assumes there is only one row in the thead.
多级表头的时候,表格样式出现混乱
Hi, Wenzhixin.
Unfortunately but under IE11 does not work.
`.table > thead > tr > th {
padding-left: 40px !important;
}
.table > tbody > tr > td:first-child {
position: absolute;
width: 40px;
}`
问题复现:
在官方"Fixed height"例子中:
http://jsfiddle.net/wenyi/e3nk137y/2954/
修改
.description {
width: 500px;
}
把500px变成50px
会发现表头"Name"与数据"bootstrap-table"不对齐.
解决方法:
修改bootstrap-table-fixed-columns.js
在位置:
that.$fixedHeader.find('th[data-field="' + visibleFields[index] + '"]')
.find('.fht-cell').width($this.innerWidth());
增加代码:
that.$fixedHeader.find('th[data-field="' + visibleFields[index] + '"]').width($this.innerWidth());
没权限pull request ,fork了一个,
在作者的基础上修改了下,如果作者有意见请通知我删除,打扰了
分享见我的库
https://github.com/langyan1022/bootstrap-table-fixed-columns
When we add data-fixed-columns="true"
to the table, the filtering(data-filter-control="input"
) for that column doesn't work.
If I use this Plugin, have a Problem with Hide/Show of Columns with Columns-Toggler. This is Problem description:
jsfiddle-Problem
Resolving is,
jsfiddle-Resolving
removing all elements of Fixed-Pluggin before Initialized.
This Modification resolve not only this problem, but also protect for Memory leaks during toggling of columns.
Dear @wenzhixin ,
Can you improve this extension to freeze right columns?
The general idea is to use negative number on data-fixed-number
or fixedNumber
option, so:
http://jsfiddle.net/anjrddygddm/e3nk137y/11552/
onClickCell event is not working if a column is fixed.
Need a solution.
如何固定头两列和最后两列,中间可以滚动
Hi wenzhixin,
this would be an awesome feature! However, I can't be able to implement it through an html data tag. Is that even possible? And to which element would it need to be added? A hint in the right direction is much appreciated.
Fixed height with fixed column that unable to scroll actual table (vertical). Understand fixed column is overlay in front of actual table. Is there a way we can scroll(vertical) actual table when mouse within fixed columns area.
demo sample: http://jsfiddle.net/wenyi/e3nk137y/2954/
“”Fixed Columns“” doesn't work with IE
http://www.tuicool.com/articles/QZnmUbv
JS组件系列——Bootstrap Table 冻结列功能IE浏览器兼容性问题解决方案
前言:最近项目里面需要用到表格的冻结列功能,所谓“冻结列”,就是某些情况下表格的列比较多,需要固定前面的几列,后面的列滚动。遗憾的是,bootstrap table里自带的fixed column功能有一点bug,于是和同事讨论该如何解决,于是就有了这篇文章。
一、起因回顾
最近项目里面有一个表格需求,该表格列是动态产生的,而且列的数量操作一定值以后就会出现横向滚动条,滚动的时候需要前面几列固定。也就是所谓的excel的冻结列功能。该如何实现呢?不用多说,当然是查文档,于是找到了这篇http://issues.wenzhixin.net.cn/bootstrap-table/index.html#extensions/fixed-columns.html。谷歌浏览器效果如下:
第一列固定
貌似问题完美解决!可是,事与愿违,很遗憾,上面说了,这是谷歌浏览器的效果,没有问题。我们来看看IE里面
IE11效果:
IE10效果:
很显然,不管是IE内核版本多少,冻结的列里面的内容都无法显示。怎么办?这可为难死宝宝了!
二、解决方案
还好有万能的开源,查看该页面源代码发现可以找到冻结列这个js的源码。
点击进入可以看到这个js的所有源码,找到源码就好办了,我们试着改改源码看是否能解决这个bug。
我们在bootstrap-table下面的extensions文件夹下面新增加一个文件夹fixed-column
下面就贴出我们改好的源码:
bootstrap-table-fixed-columns.js修改后的源码
bootstrap-table-fixed-columns.css修改后
主要修改的地方:
1)源码里面将thead和tbody分别封装成了一个单独的表格,修改后将thead和tbody放到了一个table里面;
2)依次遍历冻结的列放入到固定的tbody里面;
其实也就改了那么几个地方,就能完美解决IE的bug。我们先来看看效果:
IE11
IE10
IE8
我们再来看看如何使用。
1、引用js和对应的css
<script src="~/Content/bootstrap-table/extensions/fixed-column/js/bootstrap-table-fixed-columns.js"></script> 2、js调用如下加两个参数fixedColumns和fixedNumber即可,什么意思不用过多解释,是否冻结列、冻结列的列数。还有一点需要说明的是,这里调用的时候不能指定它的height,如果指定height,表格的冻结显示会有问题。
三、总结
以上就是表格冻结关于IE兼容性问题的解决方案,如果你也正好用到bootstrap table 的列冻结,呵呵,福利来了。总体上来说,就是在原有扩展js的基础上面做了一些小小的修改。能用,如果大伙觉得有什么问题,欢迎指出。
第一列为checkbox的多选table,checkbox列包含在冻结列中,则勾选的数据无法通过getSelections方法获取到选中行数据。
发现是fixed列是在绑定行选择事件后再添加的,没有绑定上选中事件,固选中行后选中状态未变更,进而无法获取选中数据。
现在已使用笨方法在fixed列添加后,重新绑定选中事件,可以解决此问题。
使用冻结列后表头和数据无法对齐,而且和图标一起使用的话,当拉滚动条时,图标会移动
Hi, wenzhixin.
Scrollbar bottom is hidden under fIxed columns.
http://issues.wenzhixin.net.cn/bootstrap-table/#extensions/fixed-columns.html
can you add fixed columns for table left and right side
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.