RadEditor Issue with ToolbarMode="ShowOnFocus"

4 posts, 0 answers
  1. Vivek
    Vivek avatar
    2 posts
    Member since:
    Oct 2012

    Posted 31 Oct 2012 Link to this post

    I am facing the Telerik RadEditor Issue With ToolbarMode="ShowOnFocus" working with ASP.NET
    <telerik:RadEditor ID="RadEditor1" runat="server"  OnClientLoad="OnClientLoad"  EditModes="Design" Width="300px" Height="300px"     Skin="Outlook" ToolbarMode="ShowOnFocus" ToolsFile="~/xml/Tools.xml">                                                   
    </telerik:RadEditor>

    and add a link button Click me.
    <a href="javascript://" onclick="javascript:return Clickme();">Click Me</a>

    now on page load i want to load the the tool bar by default, it is happening by doing
        function OnClientLoad(editor, args) {
               editor.setFocus();
              editor.set_html("");
            }

    but on anchor click i want to write something on radeditor and the toolbar is not visible. i tried to setFocus and set_html("") both.
    function Clickme() {
                var editor = $find("RadEditor1");
               editor.setFocus();
                editor.set_html("");
    }

    have anyone idea about this issue?

  2. Rumen
    Admin
    Rumen avatar
    14324 posts

    Posted 02 Nov 2012 Link to this post

    Hello,

    You can try the following code:

    <br /><br /><br /><br /><br /><br /><br /><br />
    <telerik:RadEditor ID="RadEditor1" runat="server"  Width="300px" Height="300px" 
       ToolbarMode="ShowOnFocus">                                                  
    </telerik:RadEditor>
     
    <a href="#"  onclick="Clickme();return false;">Click Me</a>
    <input type="button" onclick="Clickme()" value="Click Me"/>
        <script type="text/javascript">
            function Clickme() {
                var editor = $find("RadEditor1");
                if ($telerik.isIE) {
                    setTimeout(function () {
                        editor.setFocus();
                        editor.fire("Enter");
                        editor.set_html("");
                    }, 0);
                }
                else {
                    setTimeout(function() {
                        editor.setFocus();
                        editor.set_html("");
                    }, 10)
                }
            }
        </script>


    All the best,
    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.
  3. Vivek
    Vivek avatar
    2 posts
    Member since:
    Oct 2012

    Posted 07 Nov 2012 Link to this post

    Hi Rumen
    I tried your solution, but it is not working. one more issue i found that in IE(version- 9) browser the toolbar not showing in onload. while i implemeted the function. while in mozila and chrome it's fine.
      function OnClientLoad(editor, args) {
               editor.setFocus();
              editor.set_html("");
            }

    I implemented your suggested code on 
    function OnClientLoad(editor, args) {
    if ($telerik.isIE) {
                    setTimeout(function () {
                        editor.setFocus();
                        editor.fire("Enter");
                        editor.set_html("");
                    }, 0);
                }
                else {
                    setTimeout(function() {
                        editor.setFocus();
                        editor.set_html("");
                    }, 10)
                }
    }

    Thanks
    Vivek
  4. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 08 Nov 2012 Link to this post

    Hello,

    I am not quite sure why the suggested solution is not working for you. I tried it locally and it working as expected. For your convenience I have attached my test page, could you please modify it to a point where the problem occurs and send it back?

    Also, could you please verify that there are not JavaScript errors thrown during PageLoad?

    Regards,
    Dobromir
    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.
Back to Top