Possible FixedHeader Extension Defect when shifting Datatable position
Possible FixedHeader Extension Defect when shifting Datatable position

Test case can be found here: https://jsfiddle.net/jrmce/o0eqyv7r/
When the datatable’s vertical position is changed for whatever reason (in our case a div above it is increasing in size, so the datatable is shifting down) the FixedHeader thinks that the datatable is still in its original position. So, when the user scrolls past the original datatable position the header well appear twice until the user scrolls to the new, correct location of the datatable.
You can recreate this in the text case by shrinking the output panel's height, clicking the red div, and the beginning to slowly scroll down to initiate the FixedHeader. You'll see that the FixedHeader appears before the user has actually scrolled past the FixedHeader.
I can't think of any great way to fix this from a consumers perspective without listening to something like a scroll event. Perhaps there is an event in Datatables that I'm not aware of that we could leverage to trigger the recreation of the FixedHeader?
This question has an accepted answers - jump to answer
Answers
fixedHeader.adjust()
. https://jsfiddle.net/o0eqyv7r/3/Allan
Hi Allan - I apologize, I should have been more clear. I'm aware of that method, and it does correct the problem. However, I'm concerned with being able to know when the datatable has changed it's position, and then being able to call that method.
I could hook into all of the events that could potentially change the position of the datatable, but that wouldn't scale well.
It doesn't sound like this is going to be possible, but I wanted to at least see if there was something I wasn't aware of.
Yeah - this is the problem with having floating elements on top of each other. There is really no way to know when something external in the document has changed. There isn't any event that I'm aware of that DataTables could listen for - which is why you'd need to call that method whenever your code updates the page.
Sorry I don't have a better answer.
Allan
That's alright, I appreciate the response and thanks for the help Allan!