Edit this page

OnClientInit

This event is fired before the initialization of the editor's content area. You can use this method to override the editor's methods, filters, etc. This event prior to the OnClientLoad event.

function OnClientInit(editor, args)
editor object Returns a reference to RadEditor client object
args object Returns the needed information about the event

The example below demonstrates how to fix the RadEditor width in case the Editor is added dynamically to the page and its CSS files have not yet been able to load when it is shown, which results in the Editor having bigger width than the expected.

<script type="text/javascript">
    function OnClientInit(editor)
    {
        var editorWidth = editor.get_element().style.width;

        editor.add_firstShow(function ()
        {
            editor.get_element().style.width = editorWidth;
        });
    } 
</script> 
<telerik:radeditor runat="server" ID="RadEditor1" OnClientInit="OnClientInit"></telerik:radeditor>