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

After Set to FullScreen, RadEditor Changes to Design Mode

3 Answers 86 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
Junbin
Top achievements
Rank 1
Junbin asked on 29 Jul 2010, 09:38 PM

Hi,

 I am using RadEditor in a preview page. I configured EditModes as "Preview":
 
        <telerik:RadEditor ID="editor1" runat="server" Width="100%" EnableResize="false"
            Height="100%" OnClientLoad="OnClientLoad" EditModes="Preview">
            <Tools>
                <telerik:EditorToolGroup>
                </telerik:EditorToolGroup>
            </Tools>
        </telerik:RadEditor>

and in OnClientLoad event, set it as full screen: 

 

    function OnClientLoad(editor) {  

        editor.fire(

 

"ToggleScreenMode");

 

    

 

}

The problem is that after toggle to full screen mode, the editor become editable, while I am expecting the editor still in Preview mode. How do I set back to preview mode in client side (JavaScript), or is there other way to set to full screen without impacting edit mode? In this page, I only need keep the editor in preview mode (and zoom the contect).

I tried with following command (javascript) in OnClientLoad function, but it does not work:
    editor.EditModes = Telerik.Web.UI.EditModes.Preview; 
 
My other question is if can keep the editor in preview mode, and leave zoom command available?

Thank you very much,
Junbin


 

3 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 30 Jul 2010, 04:38 PM
Hi Junbin,

Here is an example how to achieve your two requests:

<telerik:RadEditor ID="editor1" runat="server" Width="100%" EnableResize="false"
    Height="100%" OnClientLoad="OnClientLoad" EditModes="Preview">
    <Tools>
        <telerik:EditorToolGroup>
        <telerik:EditorTool Name="Zoom" />
        </telerik:EditorToolGroup>
    </Tools>
    <Content>asdas</Content>
</telerik:RadEditor>
 
<script type="text/javascript">
    function OnClientLoad(editor) {
        editor.fire("ToggleScreenMode");
        editor.set_editable(false);
        editor.enableEditing(false);
        var tool = editor.getToolByName("Zoom");
        tool.setState(0); //enable the Zoom tool
    }
</script>


Kind regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Junbin
Top achievements
Rank 1
answered on 05 Aug 2010, 08:13 PM
Hi Rumen,

Thank you very much for the reply. The editor cannot be edited as expected. However, it is still in design mode, because I can still see the hidden fields. Any idea that I can hide the hidden fields?

Best regards,
Junbin
0
Junbin
Top achievements
Rank 1
answered on 06 Aug 2010, 06:30 PM
Hi Rumen,

Based on your example, I have figured out my issue. The problem is that after zoom value is changed, the editor backs to design mode. To solve the issue, I tracked OnClientCommandExecuted event, and changed the editor's property there, and the hidden fields disappeared.

Thank you very much for the help.

Junbin
Tags
WebParts for SharePoint
Asked by
Junbin
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Junbin
Top achievements
Rank 1
Share this question
or