DataTables / FixedHeader

Fix the header, footer, left or right columns of a table in place, to always show them when scrolling
http://www.datatables.net/
Other
75 stars 83 forks source link

Header hides prematurely with child rows expanded #93

Closed gilly3 closed 6 years ago

gilly3 commented 7 years ago

Repro steps:

  1. Open this page https://datatables.net/extensions/responsive/examples/display-control/fixedHeader.html
  2. Make your window narrower than 960px wide. Besides turning off the fixed page header, this makes it easier to reproduce the problem. Making it shorter than 500px tall helps too.
  3. Scroll to the bottom of the table
  4. Expand all visible child rows, starting at the bottom
  5. Scroll up and expand a few more child rows
  6. Scroll down

Expected: Fixed Header remains visible until table is out of view.

Actual: Fixed Header only remains visible until the page is scrolled past the original height of the table. Since the table's height was increased when the child rows were expanded, the Fixed Header hides while the table is still visible.

Interesting/Relevant: Now resize the window. The Fixed Header appears!

I'm using the demo provided by the Responsive extension because it's convenient, but I get this problem without using that extension, using regular child rows.

I'm working around it by calling fixedHeader.adjust() when a child row is expanded, but this seems like a bug that could be fixed relatively easily.

DataTables commented 7 years ago

Thanks for pointing that out.

The page you linked to is using FixedHeader 3.0.0 for some reason. 3.1.2 is the current release and shouldn't that this issue.

I'll look into why the Responsive example is using an old version!

gilly3 commented 7 years ago

It's still an issue with 3.1.2. I copied the example to jsfiddle.

DataTables commented 7 years ago

Doh - yes. I misunderstood slightly. I agree - FixedHeader doesn't work with child rows at the moment.

Thanks for flagging it up.

DataTables commented 6 years ago

Finally I've got around to this - sorry! It still doesn't work with using row().child() directly, but it does work with Responsive now. Using the DT API directly will need to wait until v2 I think.