Untidy radEditor until input height rendered

2 posts, 0 answers
  1. Paul Robertson
    Paul Robertson avatar
    78 posts
    Member since:
    May 2010

    Posted 20 Oct 2011 Link to this post

    Hi there

    Can anybody advise about a rather cosmetic problem I have with a radEditor that is set to be a particular height, but which makes a bit of a mess of the page the first time it is rendered. I currently have it hidden within a div, that I show last, in a bid to tidy up the display, but it doesn't seem to make much difference. What happens is that the radEditor seems to make a slight delay while it adjusts the height down to the height configured in the markup, but in the meantime the subsequent Javascript has been continuing, showing other nearby controls beneath the radEditor. They are in the correct place, but of course the radEditor is using the incorrect height for a second or so, during which the radEditor document and the other controls are scrambling about trying to occupy the same space in the window. 

    This is what I have been experimenting with so far, but it doesn't seem to matter which order I set divs or other controls to show or hide, the radEditor resize always is the last thing to get completed:

    Javascript segment:
    ------------------------ 

    // I get a reference to the div containing the radEditor further up here, calling it 'editdiv'
    // and a reference to the div underneath 'editdiv', containing the other controls, calling it 'maskdiv'

    // Display the previously hidden radEditor
    // Get reference to radEditor input document, and make sure it is hidden
    var mycmnteditor = $find("ctl00_ContentPlaceHolder1_radCommentEditor2");
    var oDocument = mycmnteditor.get_document();
    oDocument.className = 'hide';

    // Reveal the div that contains the radEditor
    $(editdiv).removeClass().addClass("show");

    // Control display of controls in the div underneath radEditor by showing their div
    maskdiv.className = 'show';

    // Finally, reveal the radEditor document, but even at this stage it is still the wrong height for a short time
    oDocument.className = 'show'; 

    ------------------------------------------

    All this Javascript works, it's just that there is the timing problem, with the radEditor height taking too long to be rendered. Is there any way to pause the rendering of other controls until the radEditor is at the right height, so that the page appearance loads more smoothly? I can't see any other client-side events in the documentation that would appear to be relevant, I already tried 'onclientload=', and it didn't seem to make any difference when I tried using it.

    Thanks if you can help
     



  2. Rumen
    Admin
    Rumen avatar
    14459 posts

    Posted 25 Oct 2011 Link to this post

    Hello Paul,

    I am aware of a similar problem which is discussed in the following forum sticky note: Incorrect rendering of RadEditor when shown with AJAX in initially hidden parent.

    If the provided solution does not help, please isolate the issue in a sample working project and send it for examination through a support ticket.

    Best regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top