RadToolTip with ShowEvent="OnFocus" doesn't appear for RadEditor

2 posts, 0 answers
  1. richardFlow
    richardFlow avatar
    62 posts
    Member since:
    Jun 2012

    Posted 11 Oct 2010 Link to this post

    I cannot get a RadToolTip to appear when a user sets focus on a RadEditor.
    The code I am using is below:


    <asp:TextBox ID="txt" runat="server" Text="try me" />
        <telerik:RadEditor ID="re1" runat="server">
        </telerik:RadEditor>
        <telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="re1"
            ShowEvent="OnFocus" Text="Test">
        </telerik:RadToolTip>
    <telerik:RadEditor ID="re1" runat="server">
    </telerik:RadEditor>
    <telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="re1"
        ShowEvent="OnFocus" Text="Test">
    </telerik:RadToolTip>

    How do I go about this?
    Thanks
  2. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 12 Oct 2010 Link to this post

    Hi,

    Here is an example on how to show RadToolTip on click in the content area of RadEditor:

    <telerik:RadEditor ID="re1" OnClientLoad="OnClientLoad" ContentAreaMode="Div" runat="server">
    </telerik:RadEditor>
    <telerik:RadToolTip ID="RadToolTip1" runat="server"
        Text="Click here" Position="BottomRight" ShowEvent="FromCode" >
    </telerik:RadToolTip>
    <script type="text/javascript">
        function OnClientLoad(editor, args) {
             
            $telerik.addExternalHandler(editor.get_contentArea(), "click", function (e) {
                 
                var tooltip = $find("<%=RadToolTip1.ClientID%>");
                tooltip.show();
                var popup = tooltip.get_popupElement();
                var leftValue = e.clientX + "px";
                var topValue = e.clientY + "px";
                $telerik.cancelRawEvent(e);
                setTimeout(function () {
                    popup.style.left = leftValue;
                    popup.style.top = topValue;
     
                }, 0);
                $telerik.cancelRawEvent(e);
            });
        }
    </script>

    The ContentAreaMode property of RadEditor should be set to Div.

    Sincerely yours,
    Rumen
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top