Resizing...

Resizing...

brianmmbrianmm Posts: 41Questions: 0Answers: 0
edited August 2009 in General
Hi Allan,

Hows things?

Have a small thing that has been 'bugging me'.... in my application, i have 2 tabs (using Yetii - http://www.kminek.pl/lab/yetii/).

Now, behind each tab is a datatable, if I tab to the 2nd tab, and go to another page, and return to this page (cookies remember that you were in the 2nd tab) it I click on the 1st tab, the datatable is incorrectly sized and to correct it I need to refresh the page using the browser....

Any ideas?

Replies

  • allanallan Posts: 61,822Questions: 1Answers: 10,129 Site admin
    Hi Brian,

    I'm guessing it's due to the fact that the browser hasn't calculated the width of the table during it's initial DOM flow (an optimisation since the second tab isn't on display) - which is something that DataTables makes use of for calculating the widths of columns. So two suggestions (assuming I am right of course...):

    1. Try sticking a style="width:600px"; or something like that into the elements.
    2. Disable DataTables' bAutoWidth calculations - but you'll need to assign widths to the columns yourself to stop the paging from causing the columns to bounce around.

    Regards,
    Allan
This discussion has been closed.