Radeditor in preview mode, need of the toggle full screen in R/O mode

4 posts, 0 answers
  1. Suzy
    Suzy avatar
    66 posts
    Member since:
    Nov 2014

    Posted 13 Feb 2015 Link to this post

    Hi,
    I have a radgrid containing a radeditor per line.  The radeditor is set enabled and in previeuw mode.  I would like to add the toggle full screen button so the user can open the text in radeditor in fullscreen and R/O.

    <telerik:RadEditor runat="server" ID="txtLogText" Enabled="false" EditModes="Preview" Height="140px" Width="1300px" ></telerik:RadEditor>

    In attachment you can find a screen shot of the RadGrid so you can see that there is not  a lot space to see the content of the radeditor.  That's why we need the full screen modus.

    Can you please help me?

    Kind regards

    Suzy
  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 17 Feb 2015 Link to this post

    Hello Suzy,

    By default, the ToggleScreenMode mode is enabled. If you have a different/custom tools configuration, you should just add it to the Tools collection and when in Preview to enable it programmatically.

    Example:
    <telerik:RadEditor ID="Editor" runat="server" EditModes="Preview" OnClientLoad="OnClientLoad">
        <Tools>
            <telerik:EditorToolGroup>
                <telerik:EditorTool Name="ToggleScreenMode" />
            </telerik:EditorToolGroup>
        </Tools>
    </telerik:RadEditor>
     
    <script type="text/javascript">
        function OnClientLoad(sender, args) {
            var commandStates = Telerik.Web.UI.Editor.CommandStates;
            sender.get_toolAdapter().getToolByName("ToggleScreenMode").setState(commandStates.Off);
        }
    </script>

    If this does not help on the case, please provide more details what is the result needed. Also, the attached snapshot does not show the RadEditor, and I am unable to define what possibly is its configuration.

    Regards,
    Ianko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Suzy
    Suzy avatar
    66 posts
    Member since:
    Nov 2014

    Posted 16 Sep 2015 Link to this post

    I got this to work in februari.

    But I just noticed that this is not working anymore.

     I'm currently working with 2015 Q2.

    Can you please help me?

    Kind regards

    Suzy

  5. Suzy
    Suzy avatar
    66 posts
    Member since:
    Nov 2014

    Posted 16 Sep 2015 Link to this post

    I have found the solution : http://www.telerik.com/forums/toggle-mode-is-not-working-in-preview-mode-and-working-functionality-got-break-after-telerik-upgrade.

    I changed my javascript and used OnClientModeChange instead of OnClientCommandExecuting :

    function OnClientLoad(sender, args) {
     Telerik.Web.UI.RadEditor.prototype._nonEditableCommands.push("ToggleScreenMode");
     }
      
    function OnClientModeChange(editor, args) {
     setTimeout(function () {
     editor.set_editable(false);
     editor.enableEditing(false);
     var tool = editor.getToolByName("ToggleScreenMode");
     tool.setState(0);
     }, 0);
     }

    kind regards 

    Suzy 

     

Back to Top