简体   繁体   English

带有固定列的 jQuery 数据表垂直滚动错误

[英]jQuery datatables vertical scroll bug with fixed column

Ok i have noticed this bug with FireFox and IE 11 how to replicate it:好的,我已经注意到 FireFox 和 IE 11 的这个错误如何复制它:

  • Start scrolling on the fixed column开始在固定列上滚动
  • While its scrolling move the mouse over to the other data当它滚动时,将鼠标移到其他数据上
  • Result: not aligned rows结果:未对齐的行

Live demo现场演示

$.fn.dataTableExt.sErrMode = 'ignore';
$('#myTable01').DataTable( {
    scrollY:        "200px",
    scrollX:        true,
    scrollCollapse: true,
    paging:         false,
    fixedColumns:   true,
    bPaginate: false,
    bFilter: false,
    bInfo: false,
    bSort: false,

} );

在此处输入图片说明

Is there a way to fix this in FireFox and IE?有没有办法在 FireFox 和 IE 中解决这个问题? I have tried chrome and it works fine there.我试过 chrome,它在那里工作得很好。

file: dataTables.fixedColumns.js文件:dataTables.fixedColumns.js

Delete row: iBodyweight -= oOverflow.bar;删除行:iBodyweight -= oOverflow.bar;

Sorry for late response. 抱歉迟了回应。 I am also faced similar issue. 我也面临类似的问题。 Given the fix below. 鉴于以下修复。 Please try & let me know,if any challenges. 如果有任何挑战,请尝试让我知道。

File: dataTables.fixedColumns.js Version : 3.2.4 文件:dataTables.fixedColumns.js版本:3.2.4

Update below condition in "scroll.DTFC" Event 在“ scroll.DTFC”事件中更新以下条件

Existing Code: ` 现有代码:

 if (mouseController === 'main') {
        if (that.s.iLeftColumns > 0) {
      that.dom.grid.left.liner.scrollTop = that.dom.scroller.scrollTop;
 }
  if (that.s.iRightColumns > 0) {
                                                                that.dom.grid.right.liner.scrollTop = that.dom.scroller.scrollTop;
 }`

Updated Code : ` if (mouseController === 'main'|| mouseController === 'left') {
if (that.s.iLeftColumns > 0) {
                                                                that.dom.grid.left.liner.scrollTop = that.dom.scroller.scrollTop;
  }
 if (that.s.iRightColumns > 0) {
                        that.dom.grid.right.liner.scrollTop = that.dom.scroller.scrollTop;
                                                            }
 }

` `

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM