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

Client load event not firing with Editor is disable

3 Answers 85 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Guillermo Andres
Top achievements
Rank 1
Guillermo Andres asked on 23 Nov 2011, 10:10 PM
Hi all,

I have a RadEditor that changes between edit and view mode. When disabling the Editor, the toolbar disappear and it looks cleaner for view mode but the OnClientLoad and OnClientInit event are not triggering. As soon as I enable the editor, it works.  

Any work around?

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 24 Nov 2011, 04:19 PM
Hi Grillonegro,

When the Enabled property of RadEditor is set to false, then the editor is rendered as a standard DIV element on the page and its content is loaded in this DIV. Since there is no editor on the page its client event are not loaded. This is by design.

If you would like to disable the editor without rendering a DIV on the page, you should do that on the client using the editor.enableEditing(false) method. Here is an example:

<telerik:RadEditor runat="server" ID="RadEditor1">
<Content>some test content</Content>
</telerik:RadEditor>
<input type="button" onclick="toggleEditing();return false;" value="Toggle editing" />
<script type="text/javascript">
var toggle = true;
function toggleEditing()
{
var editor = $find("<%=RadEditor1.ClientID%>");
toggle = !toggle;
editor.enableEditing(toggle);
editor.set_editable(toggle);
if (toggle == false) editor.get_document().body.style.backgroundColor = "gray";
else editor.get_document().body.style.backgroundColor = "";
}
</script>

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
0
Guillermo Andres
Top achievements
Rank 1
answered on 02 Dec 2011, 06:32 PM
Is there a way to disable the Toolbar on client side ?

Thanks
0
Guillermo Andres
Top achievements
Rank 1
answered on 02 Dec 2011, 09:15 PM
If I set the property ToolbarMode=ShowOnFocus when RadEditor is on Preview mode, the toolbar wont be displayed.  This is the functionality I was looking for. 

Many thanks. 
Tags
Editor
Asked by
Guillermo Andres
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Guillermo Andres
Top achievements
Rank 1
Share this question
or