Skip to content
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

Allow function to dynamically calculate stickyHeaders_offset #1412

Closed
MartinMuzatko opened this issue Jun 1, 2017 · 4 comments
Closed

Allow function to dynamically calculate stickyHeaders_offset #1412

MartinMuzatko opened this issue Jun 1, 2017 · 4 comments

Comments

@MartinMuzatko
Copy link

MartinMuzatko commented Jun 1, 2017

Hello.

My fixed header is responsive, it resizes on mobile. However, tablesorter does not account for that as it looks.

I think the height is only retrieved once on initialization, not when making the sticky header visible.

@Mottie
Copy link
Owner

Mottie commented Jun 1, 2017

Hi @MartinMuzatko!

Hmm, both the stickHeaders and cssStickyHeaders widgets should allow for updating of the offset widget option dynamically, but you won't see the updated value get applied until the page is scrolled, or you trigger a "resize" event on the window.

And of course I just tested it and it didn't work 🤣

I'll spend some time on this today.

@MartinMuzatko
Copy link
Author

Thank you :)

@Mottie Mottie closed this as completed in 9d27c66 Jun 1, 2017
@Mottie
Copy link
Owner

Mottie commented Jun 1, 2017

Ok, this fix is now available in the master branch for the stickyHeaders widget. The cssStickyHeaders widget was already working properly.

If you don't want to trigger a "resize" event, you could also trigger a "stickyHeadersUpdate" event on the table to apply the modified offset:

$('table').trigger('stickyHeadersUpdate');

@Mottie
Copy link
Owner

Mottie commented Jun 1, 2017

Here's a demo that changes the offset after 5 seconds: https://jsfiddle.net/f36416oy/42/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants