Autoresize problem

Autoresize problem

amitdgramitdgr Posts: 8Questions: 0Answers: 0
edited May 2009 in General
Hi Allan,

In our application, we are showing the datatable using an iFrame. When the number of rows exceeds 10(default), the rows overflow the frame and it appears as if the table is cropped abruptly. We would ideally like the frame size to grow or shrink as the datatable size changes. How do we do this ?

This is very similar to the fieldset problem I posted a couple of days back, but strangely that discussion is missing :( . We are trying to put a fieldset around the datatable and when someone changes the number of rows from the dropdown, the table just overflows the fieldset.

Amit

Replies

  • allanallan Posts: 63,578Questions: 1Answers: 10,483 Site admin
    Hi Amit,

    Firstly, sorry to hear that one of your posts appears to have disappeared. Checking the stats of the forum shows that this is the only topic you have posted, so I'm not entirely sure what happened there. I did have server issues about a week ago, and I suppose it's possible that the post got lost there. These problems should be over now, so if you do any have questions, please do post again and accept my apologies.

    With regard to your question here - the behaviour it sounds like you want could be done by just wrapping the table in a DIV rather than an iframe. Is there any reason you are using an iframe (importing a different document perhaps?) rather than an element in the current document?

    What you might be able to do is in the iframe, add an fnDrawCallback() function to DataTables which will fire every time the table is updated, and get the offsetHeight of the element which surrounds the table. Then you can tell the parent document (the one with the iframe) what the new height of the table is, such that it can re-size the iframe as needed.

    Hope this helps,
    Allan
This discussion has been closed.