Vertical scrolling on SlickGrid doesn't have any effects when hovering over frozen columns

Viewed 359
2 Answers

Dont forget to include script "SlickGrid-2.4.29/lib/jquery.mousewheel.js" on your page.

SlickGrid uses 2 <div> containers and because of that only the last one will have the scroll working, you need to do some jQuery tricks to have mouse scrolling work

// 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();
});
Related