NemoDima
NemoDima

Reputation: 37

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

It works properly when hovering over non-frozen columns: ![screen with the example][1]

Why does it happen? What information could help to debug the problem?

The same question on the 6pac/SlickGrid fork: https://github.com/6pac/SlickGrid/issues/528

UPD. Example: https://angular-empty-project-zoc3ab.stackblitz.io/ [1]: https://i.sstatic.net/DLZSP.png

Upvotes: 2

Views: 633

Answers (2)

ghiscoding
ghiscoding

Reputation: 13194

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

Upvotes: 0

Sadri Lassoued
Sadri Lassoued

Reputation: 58

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

Upvotes: 1

Related Questions