FixedHeader with css position fixed scroll-able parent
FixedHeader with css position fixed scroll-able parent
The layout of our site uses a css fixed header and a css fixed content div below the header with overflow: Y scrolling.
With the current implementation of FixedHeader no scroll events are captured because the main window is not scrolling. I was able to make FixedHeader work on our site by adding a hack to capture scroll events on our scrollable div but it is clearly not the right way do this long term.
From within _constructor:
$('#content').on('scroll'+this.s.namespace, DataTable.util.throttle( function () {
that.update();
}, 50 ));
With this hack FixedHeader works properly through all tested scenarios.
Do you have suggestions on how this functionality could be properly integrated into the FixedHeader plugin?
Perhaps a new option called 'scrollableParent' could be added with a jQuery selector? Then the scroll and resize events could be bound to that parent instead of the window. Some changes to the _position function also appear to be necessary.
Answers
Think this is a duplicate of this other thread. Going to close this one in favour of the other.
Allan