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

Editor resizing on in html mode

2 Answers 52 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
pyrophone
Top achievements
Rank 1
pyrophone asked on 29 Aug 2007, 04:27 PM
Hi - I have an impelmentation of MOSS 2007 RadEditor which requires a small edit window (DisplayWidth="238"). This works fine until I click on the HTML edit mode button. At this point the editor resizes itself to over 450px wide, and stays that wide even when I go back to WYSIWYG mode.

This is very frustrating! I can't find css classes to control it -- anyone have a solution?

2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 04 Sep 2007, 03:31 PM
Hi Pyrophone,

You can fix the problem by attaching the following JavaScript function to the editor's property OnClientModeChange property in the ConfigFile.xml file, e.g.

<script language="javascript">
function OnClientModeChange(editor)
{
    var htmlArea = document.getElementById("RadEContentTextarea" + editor.Id);
    htmlArea.style.width = (editor.GetWidth()-12) + "px";
}
</script>


Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
pyrophone
Top achievements
Rank 1
answered on 05 Sep 2007, 07:25 PM
Works great! Thank you!

In case others are a bit vague on the meaning of "attaching the following JavaScript function to the editor's property OnClientModeChange property in the ConfigFile.xml", I added
<property name="OnClientModeChange">OnClientModeChange</property>
 
 to the ConfigFile.xml.

Then I added the javascript snippet to my masterpage via Sharepoint Designer.
Tags
WebParts for SharePoint
Asked by
pyrophone
Top achievements
Rank 1
Answers by
Rumen
Telerik team
pyrophone
Top achievements
Rank 1
Share this question
or