After Set to FullScreen, RadEditor Changes to Design Mode

4 posts, 1 answers
  1. Junbin
    Junbin avatar
    9 posts
    Member since:
    Jun 2010

    Posted 29 Jul 2010 Link to this post

    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


     

  2. Answer
    Rumen
    Admin
    Rumen avatar
    12849 posts

    Posted 30 Jul 2010 Link to this post

    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.

  3. Junbin
    Junbin avatar
    9 posts
    Member since:
    Jun 2010

    Posted 05 Aug 2010 Link to this post

    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
  4. Junbin
    Junbin avatar
    9 posts
    Member since:
    Jun 2010

    Posted 06 Aug 2010 Link to this post

    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
Back to Top