.scrollHeight returning zero?!

2 posts, 0 answers
  1. Jesse Lawler
    Jesse Lawler avatar
    46 posts
    Member since:
    Apr 2010

    Posted 25 Jul 2010 Link to this post

    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);
        }
    }

  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 28 Jul 2010 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top