【问题标题】:Vertical scrolling on SlickGrid doesn't have any effects when hovering over frozen columns悬停在冻结列上时,SlickGrid 上的垂直滚动没有任何效果
【发布时间】:2020-08-25 13:06:40
【问题描述】:

当悬停在非冻结列上时它可以正常工作: ![示例屏幕][1]

为什么会这样? 哪些信息有助于调试问题?

关于 6pac/SlickGrid fork 的相同问题: https://github.com/6pac/SlickGrid/issues/528

UPD。示例:https://angular-empty-project-zoc3ab.stackblitz.io/ [1]:https://i.stack.imgur.com/DLZSP.png

【问题讨论】:

标签: javascript slickgrid


【解决方案1】:

不要忘记在您的页面上包含脚本“SlickGrid-2.4.29/lib/jquery.mousewheel.js”。

【讨论】:

    【解决方案2】:

    SlickGrid 使用 2 个 <div> 容器,因此只有最后一个容器可以滚动工作,您需要做一些 jQuery 技巧才能使鼠标滚动工作

    // with frozen (pinned) grid, in order to see the entire row being highlighted when hovering
    // we need to do some extra tricks (that is because frozen grids use 2 separate div containers)
    // the trick is to use row selection to highlight when hovering current row and remove selection once we're not
    grid.onMouseEnter.subscribe(event => {
          const cell = this.gridObj.getCellFromEvent(event);
          grid.setSelectedRows([cell.row]); // highlight current row
          event.preventDefault();
    });
    grid.onMouseLeave.subscribe(event => {
          grid.setSelectedRows([]); // remove highlight
          event.preventDefault();
    });
    

    【讨论】:

    猜你喜欢
    • 2015-10-10
    • 1970-01-01
    • 2020-12-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多