RadTooltipManager AutoTooltipify, update after title changed in JS

2 posts, 0 answers
  1. Ken
    Ken avatar
    1 posts
    Member since:
    Jun 2013

    Posted 21 Jun 2013 Link to this post

    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
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3600 posts

    Posted 25 Jun 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top