Issue PageResize in hidden div

Issue PageResize in hidden div

sebacodesebacode Posts: 5Questions: 0Answers: 0
edited September 2020 in Free community support

http://live.datatables.net/fodahuvu/1/edit

Hello, please check live code ... I have a table in a hidden div and when show it for first time, the table does not appear with PageReize well.

But when I change the table page, it manages to adapt well to the container....any idea?

thanks

Replies

  • sebacodesebacode Posts: 5Questions: 0Answers: 0
  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    It seems to work as expected for me. Please can you give steps on how to reproduce the issue, and what you would expect to see instead,

    Colin

  • sebacodesebacode Posts: 5Questions: 0Answers: 0

    Hello colin, thanks for you answer. Check image please, see a wrong scroll-y is show, to fix it, go to the last page of table.

    To reproduce the error again, refresh page, cuz only occur first time.

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin

    Have you since managed to resolve this? When I run your example it shows 1-7 rows with no scrollbar.

    Allan

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin

    Colin has just pointed out to me that it happens in Chrome, but not Firefox which I was using.

    The workaround you have to call draw() after the setTimeout is probably required here.

    Allan

  • sebacodesebacode Posts: 5Questions: 0Answers: 0

    Thanks Allan, you are right! only happens in Chrome.

    I do test with draw() and nothing

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Allan meant your commented out code,

        //TRICK - DISCOMMENT THIS TO RESOLVED
    //     table.page( 'last' ).draw('page');
    //     setTimeout( function(){
    //         table.page( 'first' ).draw('page');
    //     }, 200 );
    

    If you enable that again, the problem is resolved.

    Colin

  • sebacodesebacode Posts: 5Questions: 0Answers: 0
    edited September 2020

    Right, but in some cases it doesn't work

    there is another solution? manually i try call _size() of PageResize plugin but i can't

    thanks.

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Right, but in some cases it doesn't work

    Could you expand on that, please, and let us know how to reproduce those cases with the test case you provided - that would help us understand the problem.

    Colin

This discussion has been closed.