Code Monkey home page Code Monkey logo

bootstrap-table-fixed-columns's Introduction

bootstrap-table-fixed-columns's People

Contributors

caseyheckman avatar edouardberthe avatar miles-x avatar pianomansam avatar wenzhixin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bootstrap-table-fixed-columns's Issues

作者这个插件有很多样式问题和BUG还修复吗

在实际的项目使用中发现作者这个插件 存在很多问题 样式错乱 对不齐 固定列后 固定列的样式不能应用表格的样式 什么滚动条被挡住 等等
特别是复杂表格头和有自定义样式的时候 这个插件乱的一团糟 我看这里下面反馈这个插件有问题的不是一个两个
望作者 修复

Table height wrong when no horizontal scroll

fixed columns when too few columns

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 :

  • We must check before if the scroll is up, and then substract -14, if the scroll is not here, table height with no substraction must be declared.

How can we check if the scroll is up ?

little problem

on picture some fixed column not working good. scroll bar and fixed column sort not working. something is wrong..

1111

没有横向滚动条时 表头与表格数据不对齐 已自己解决

问题复现:

在官方"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());

Problem with toggle Columns

If I use this Plugin, have a Problem with Hide/Show of Columns with Columns-Toggler. This is Problem description:
jsfiddle-Problem

  • First two Columns are fixed
  • Data for Cell0 und Cell1 habe a large text
  • Now, deselect first Column
  • You can sie, that old copy of Table is available and visible.
  • This is a 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.

Add way to freeze column at right side

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:

  • When it is 1 or greater left columns will be freezed, like now
  • When it is 0 no columns will be freezed but just headers, like now
  • When it is -1 or less right columns will be freezed

错位严重

fix

100条,错位了11条,请问还在维护吗?

固定列

如何固定头两列和最后两列,中间可以滚动

How to implement without javascript

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 Columns“” doesn't work with IE

“”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列在设置为冻结列后多个勾选获取选择列失效

第一列为checkbox的多选table,checkbox列包含在冻结列中,则勾选的数据无法通过getSelections方法获取到选中行数据。
发现是fixed列是在绑定行选择事件后再添加的,没有绑定上选中事件,固选中行后选中状态未变更,进而无法获取选中数据。
现在已使用笨方法在fixed列添加后,重新绑定选中事件,可以解决此问题。

thead和tbody无法对齐

使用冻结列后表头和数据无法对齐,而且和图标一起使用的话,当拉滚动条时,图标会移动

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.