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

Editor Loading with a white background

3 Answers 63 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Lasa Jay
Top achievements
Rank 1
Lasa Jay asked on 01 Jul 2008, 04:30 AM

Hi guys,

I'm having a bit of a problem with the new Rad Editor(Ajax) control. It shows a white background in the content area before setting the content. This white background stays in the editor until it finishes loading.
I'm wondering whether there is a way to get rid of it. This never used to happen in the Rad Editor Classic.

Also If there are more rad controls in the page it stays in the editor for even longer until editor gets loaded (its ugly when editor is the last control to load up).

Thanks in advance,

lasa

3 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 01 Jul 2008, 03:12 PM
Hi Lasa Jay,

My suggestion is to put the editor in a hided div and show it when the page finish its loading:

<div id="hiddenDiv" style="display:none;">
    <telerik:radeditor runat="server" OnClientLoad="OnClientLoad" ID="RadEditor1"></telerik:radeditor>
    <script type="text/javascript">
    function OnClientLoad(editor)
    {
        setTimeout(function()
        {
            $get('hiddenDiv').style.display = '';
        }, 1500);
    }
    </script>
</div>

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Lasa Jay
Top achievements
Rank 1
answered on 02 Jul 2008, 12:17 AM
Hi Rumen,

 Thanks for the solution. just one question, i dont really understand why there is a setTimeout. It seems to work fine without it (i dont want anymore pauses).
 
i changed your function a little bit so i can have a global javascript function instead of putting script blocks under each editor.

  function OnClientLoad(editor)
  {
        var divEle = editor._rootElement.parentNode;
           divEle.style.display =
'';   
  }
 
btw can we change the rendering order of the telerik objects in the client side. For example its great if i can force the editors to load up before other telerik controls.

Regards,

Lasa
0
Tervel
Telerik team
answered on 04 Jul 2008, 07:37 AM
Hello Lasa,

You are correct - there is no need for the timeout. The timeout was needed in the RadEditor Classic, as it has a different initialization mechanism.

Other than that, I would suggest using not the "private" variables of RadEditor, but their public getters and setters, e.g. use get_element() instead of _rootElement.

The controls initialization sequence is mandated by MS AJAX mechanism, upon which all RadControls for ASP.NET AJAX are built. It initializes client control in the same sequence as they have been added to the page.


Sincerely yours,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
Lasa Jay
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Lasa Jay
Top achievements
Rank 1
Tervel
Telerik team
Share this question
or