+ Start a Discussion

Resize the fleld height of an s-control?

Hi all. 

I have an s-control that mimcs the listing of a related object.  All well and good.  My one hitch right now is that I'd like the iframe that the s-control is shown in to be flexible.  I don't want to make the height of the field containing the s-control to be 300px if the result set back is only something like 80px.  Is this at all possible?  I could calculate something like 20px per table row created to return the right height.

Am I just dreaming on this one?  Are we really stuck with scrollbars and fixed height?

Many thanks.
I just answered this question last week, found by searching the forums. Here's the code:

    function resizeIframe(height) {
var id = new String(window.name);
var iframeElement = parent.document.getElementById(id);
iframeElement.style.height = height + "px"

You can also replace "height + "px"" with "window.scrollHeight" to automatically resize the window to the optimal size (although, you might need to adjust the values for IE or Firefox to get a better resize value).
Ah duh...I did that same thing for a previous integration.