FixedHeader in a scrollable div

FixedHeader in a scrollable div

HuubHuub Posts: 2Questions: 0Answers: 0
edited February 2010 in General
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.

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Hi Huub,

    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
  • rewenrewen Posts: 74Questions: 2Answers: 0
    If anyone has a solution to this I would love to be able to put it to use. I have a web application wherein the datatables are in a div with overflow-y (ie a scrollable div) and as the op states, this doesn't work so hot.

    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
This discussion has been closed.