FixedHeader in a scrollable div
FixedHeader in a scrollable div
Hi,
First off: great plugin, it's the best table widget I've seen and I love every single feature in it.
I've just tried to make use of the FixedHeader plugin but it behaves strange in a "scrollable div". Somehow it fails to find the top of the page (or actually, it needs the top of the div) and stays fixed where it started. I have altered the example page in the distribution to show this behavior. Basically the whole page lives in a dive with a style like:
[code]#module {
position: fixed;
top: 4.2em;
bottom: 4.2em;
left: 0em;
right: 0em;
overflow: auto;
padding: 0.5em;
}[/code]
Here's a (your own) demo: http://www.huubpeters.com/datatables/extras/FixedHeader/
Any tips on how to fix this?
Thanks.
First off: great plugin, it's the best table widget I've seen and I love every single feature in it.
I've just tried to make use of the FixedHeader plugin but it behaves strange in a "scrollable div". Somehow it fails to find the top of the page (or actually, it needs the top of the div) and stays fixed where it started. I have altered the example page in the distribution to show this behavior. Basically the whole page lives in a dive with a style like:
[code]#module {
position: fixed;
top: 4.2em;
bottom: 4.2em;
left: 0em;
right: 0em;
overflow: auto;
padding: 0.5em;
}[/code]
Here's a (your own) demo: http://www.huubpeters.com/datatables/extras/FixedHeader/
Any tips on how to fix this?
Thanks.
This discussion has been closed.
Replies
I'm sorry to say that this isn't something which is supported by FixedHeader at the moment, and if tried, the results (as seen) are going to be unpredictable. The reason for this is that all scrolling calculations are done relative to the window / document, rather than the scrolling div. It might be possible to hack the calculations used in FixedHeader (at the bottom of the js file) to allow this to work, but not currently supported - sorry.
Regards,
Allan
I am going to try to change the calculations as suggested by alan, but I don't think I'm going to have as much luck :p