Closed ahoppen closed 6 years ago
Hi,
Thanks for the detailed bug report! I'm sorry to say that FixedHeader is not currently compatible with the scrolling features in DataTables (see the compatibility chart).
Issues #7 and #80 cover this. It is certainly something I plan to add in future - I'm slightly nervous about the extra complexity it will add, I think the basics will actually be really easy with how FixedHeader works now, but getting it right will probably be quite fiddily!
Thanks for the update.
I didn't even know FixedHeader wasn't compatible with scrolling and FixedColumns because it always worked well for me.
Going to close as a duplicate.
Description
If you have a DataTable that is not aligned with the top of the page, has
fixedHeader
enabled andscrollY
set, scroll to the bottom of the table (less scrolling also works, but no pattern could be detected so far) and then resize the window, the table's header is added to the current page'sbody
, being displayed on the top of the page.This header is obviously unintended and should not be visible
Sample project
Please find a fully self-contained sample project, demonstrating the issue attached: DataTables Bug.zip
Investigation results
The header gets added to the DOM tree in the
_clone
method ofFixedHeader
. Specifically in this statement:Removing the last line
appendTo( 'body' )
seems to resolve the issue for fixed headers but since I can't believe that the line is useless, I refrained from filing a pull request.FixedColumns
This bug also seems to stop
FixedColumns
from showing a fixed column after the resize. Uncomment the lines enablingFixedColumns
inbug.html
in the attached sample project to see the issue.