Problem with scrollY using with several tables

Problem with scrollY using with several tables

AstralKillAstralKill Posts: 3Questions: 1Answers: 0

Here is a link to test case: http://live.datatables.net/yapopepe/1/edit
The problem is I can't really understand, due to the lack of experience, what is going wrong with the first table's header.
I want to have several tables on page hidden while datatables component is initializing, and after it's done, show them normally.
I have read about "fnInitComplete" and it seems to work as intended here, but somehow the header of first table on the page just disappears (so it happens in my real project).
It also looks like there are no clear errors.
How can i fix this kind of behavior and what is causing it?

This question has an accepted answers - jump to answer

Answers

  • tangerinetangerine Posts: 3,350Questions: 37Answers: 394
    edited June 2020

    Your tables have "style='display:none'" which may explain your problem.

  • AstralKillAstralKill Posts: 3Questions: 1Answers: 0

    Yes, when there is no "style='display:none'", both of headers with applied scrolling option are OK, but when style is used, why $('#example, #example2').show(); works like this for 2nd and doesn't work for 1st?
    P.S. When scrollY option is removed, everything is shown well even with style='display:none'. Is there smth obvious I don't know probably?

  • colincolin Posts: 15,176Questions: 1Answers: 2,589
    Answer ✓

    I'm not sure either, but a workaround perhaps would be to make the container hidden, and show that - see here.

    Colin

  • AstralKillAstralKill Posts: 3Questions: 1Answers: 0

    That thing with hidden container actually worked, thank you! Still didn't realize what is bugging with hidden table though, maybe will search more about it later.

This discussion has been closed.