-
Notifications
You must be signed in to change notification settings - Fork 292
Allow many tables on one page, add dynamic offset and fix bugs #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Cloning the header can result in generating tags with duplicate ids. This change adds suffixes to all ids in tags within the $clonedHeader.
When we set "position: fixed" on header, it is shown before other DOM elements. This behaviour is causes problems because, for instance, header is shown outside of its container. I prepared interactive demo in demo/scrollable-div-with-clipping-container.html
Before this change there was an issue with horizontal scroll in scrollableArea. You can observe it by scrolling horizontally div in demo/scrollable-div-with-clipping-container.html
Top position should not be zero when table is in modal. This caused a problem. When scrolling the header would blink. Copied top value from function setPositionValues.
User can provide a function which computes the offset. It can be useful, when one uses sticky menu above sticky headers and position of sticky menu can change on scroll.
We don't want to use debounced functions during initialization to prevent blinking.
| 'position': 'fixed', | ||
| 'margin-top': base.options.marginTop, | ||
| 'top': 0, | ||
| 'top': base.topOffset - (base.isWindowScrolling ? 0 : base.$window.scrollTop()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, when can I expect this code to be available in main code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably never, because the author does not respond. But these changes are available in this fork: https://github.com/Roblens/StickyTableHeaders
|
Merge this! |
|
In case anyone still using this I forked that and merged this bug fix and having a CDN link on jsdeliver: |
Bunch of bug fixes, flickering fixes, and performance improvements. Now you can have more than one table on one page. Better performance for large tables on Internet Explorer. Add possibility to dynamically offset the header when using with other sticky, interactive elements on the page
$clonedHeader.div in demo/scrollable-div-with-clipping-container.html
dynamicTopOffsetUser can provide a function which computes the offset. It can be useful, when one uses sticky menu above sticky headers and position of sticky menu can change on scroll.