FixedHeader + that changes its height

FixedHeader + that changes its height

Ted TTed T Posts: 4Questions: 2Answers: 0

Link to test case: https://live.datatables.net/jegepelu
Debugger code (debug.datatables.net): n/a
Error messages shown: n/a
Description of problem: This is more of an observation; I have figured out how to do what I want it to do.

I have a header div on my page, with a DataTable with FixedHeader below my header div. The header div is decorated with class='fh-fixedHeader so that DataTable / FixedHeader automatically sets the headerOffset.

After the DataTable is completely drawn, I want to change the height of the header div. There does not appear to be an easy way to re-calculate the headerOffset.

See test case above. To see the problem, click the first button in the pink header section, then scroll the table. The FixedHeaders are still displayed in their original location when the DataTable was first constructed.

The second button in the pink header section runs the JS to re-calculate the offsetHeader. It would be nice if this could be in fixedHeader.adjust() , or a new function altogether ( or fixedHeader.offsetHeader( null ) ... )

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 65,638Questions: 1Answers: 10,916 Site admin
    Answer ✓

    I think that's an excellent idea - thanks for the suggestion. I've committed a change to do this now. It is on the dt3 branch, which will require DataTables 3+, which is still in development - hopefully a beta soon.

    As you mentioned you have worked out how to get it working as you want for the moment, I'll probably not backport this new feature.

    Allan

Sign In or Register to comment.