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

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

1 Answer 39 Views
Editor
This is a migrated thread and some comments may be shown as answers.
richardFlow
Top achievements
Rank 1
richardFlow asked on 11 Oct 2010, 08:40 PM
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

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 12 Oct 2010, 10:40 AM
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
Tags
Editor
Asked by
richardFlow
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or