This is a migrated thread and some comments may be shown as answers.

.scrollHeight returning zero?!

1 Answer 112 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Jesse Lawler
Top achievements
Rank 1
Jesse Lawler asked on 26 Jul 2010, 02:33 AM
Hi there --

I've built a little Javascript function to properly set the height of my Splitters when they're loaded on a TabPanel that keeps them hidden at the completion of the page's load event.  However, there's trouble in paradise: When I try to grab the new height variable with a call to pane.getContentElement().scrollHeight... I get zero as a result!

This definitely isn't right; there's a 600-pixel tall image in the pane.  What's going on?

Thanks,

Jesse

function ResetRadPaneHeight(splitterID, paneID) {
    var splitter = $find(splitterID);
    if (splitter) {
        splitter.repaint();
        var pane = splitter.getPaneById(paneID);
        var height = pane.getContentElement().scrollHeight;
        if (height != 0) { // if height is 0, something is amiss...
            splitter.set_height(height);
            pane.set_height(height);
        }
        else
        {
            alert('For some reason ' + paneID + '.getContentElement().scrollHeight = 0');
        }
    } else {
        // recursively try this function again in 1 second
        setTimeout('ResetRadPaneHeight(\'' + splitterID + '\', \'' + paneID + '\');', 1000);
    }
}

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 28 Jul 2010, 03:24 PM
Hi Jesse,

I tried to reproduce the problem with the provided JavaScript function but to no avail. Could you please provide more detailed information regarding the specific scenario?
  • Which version of RadControls and .NET Framework are used in the application?
  • Under which browser and its version the problem occurs?
  • Could you please provide sample runnable project that reproduces the problem so we can investigate it further?

For your convenience I have attached my test project. Please modify it to a point where the problem occurs, open a support ticket and send it back - we will check it right away.

All the best,
Dobromir
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Splitter
Asked by
Jesse Lawler
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or