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

RadTooltipManager AutoTooltipify, update after title changed in JS

1 Answer 91 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 21 Jun 2013, 04:37 PM
I'm using a RadTooltipManager with AutoTooltipify set on a zone using ToolTipZoneID.  Within that zone, I'm changing one some of the tooltipped elements' titles in Javascript.  I'm not using UpdatePanels for this and am sticking with straight jQuery.  Since the TooltipManager removes the title of the element when it "tooltipifies" it, and I'm now changing the title, it adds the title attribute back onto the element and I end up with two tooltips.  The RadTooltip shows the old title, and the browser pops up the new one.  Is there a way to signal the TooltipManager to update itself and reset the tooltips to current values (and remove the new title attribute as it did on initial load)?  Any guidance would be appreciated.

--
Ken

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 25 Jun 2013, 10:45 AM
Hi ken,

You can have the RadToolTipManager recreate tooltips for a given area though its client-side API - the tooltipify(element|null) mehod (scroll down to the second section that treats the RadToolTipManager API). Here is a small example:
<telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" ToolTipZoneID="zone" AutoTooltipify="true">
</telerik:RadToolTipManager>
<script type="text/javascript">
    function changeTitle()
    {
        var link = $get("second");
        var ttManager = $find("<%=RadToolTipManager1.ClientID %>");
        link.setAttribute("title", "new title for the second link");
        var zone = $get("zone");
        ttManager.tooltipify(zone);
    }
</script>
<div id="zone">
    <a href="#" title="first">first</a>
    <a href="#" title="second" id="second">second</a>
    <asp:Button ID="Button1" Text="change second link title" OnClientClick="changeTitle(); return false;" ToolTip="change second link title" runat="server" />
</div>



Regards,
Marin Bratanov
Telerik
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 the blog feed now.
Tags
ToolTip
Asked by
Ken
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or