Skip to content

Commit

Permalink
Fix mleibman#428 - scroll the main area when the header row is scrolled.
Browse files Browse the repository at this point in the history
  • Loading branch information
mleibman committed Aug 31, 2012
1 parent 127944b commit 8346343
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions slick.grid.js
Expand Up @@ -296,6 +296,8 @@ if (typeof Slick === "undefined") {
.bind("click", handleHeaderClick)
.delegate(".slick-header-column", "mouseenter", handleHeaderMouseEnter)
.delegate(".slick-header-column", "mouseleave", handleHeaderMouseLeave);
$headerRowScroller
.bind("scroll", handleHeaderRowScroll);
$focusSink
.bind("keydown", handleKeyDown);
$canvas
Expand Down Expand Up @@ -1894,6 +1896,13 @@ if (typeof Slick === "undefined") {
h_render = null;
}

function handleHeaderRowScroll() {
var scrollLeft = $headerRowScroller[0].scrollLeft;
if (scrollLeft != $viewport[0].scrollLeft) {
$viewport[0].scrollLeft = scrollLeft;
}
}

function handleScroll() {
scrollTop = $viewport[0].scrollTop;
scrollLeft = $viewport[0].scrollLeft;
Expand Down

0 comments on commit 8346343

Please sign in to comment.