AutoTooltipify and changing alt from javascript

2 posts, 1 answers
  1. Dave
    Dave avatar
    38 posts
    Member since:
    Jul 2007

    Posted 24 Aug 2012 Link to this post

    Here is my scenario:

    I have one RadToolTipManager on a page with a bunch of images representing statuses. When the page first loads, the tooltips work correctly for the images. We have javascript functions that change the alt attribute of those images. But after the alt is changed via javascript, the tooltip still shows the old text and not the new updated text. is there a way to not cache the tooltips?
  2. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    3596 posts

    Posted 27 Aug 2012 Link to this post

    Hello Dave,

    There isn't an event that fires when an attribute is changed on the HTML elements, so the tooltip manager cannot know of this. It goes through the page when the page loads and this is when it takes the values. What you can try is to call its tooltipify() method after you are done changing the attributes:
    $get("img1").setAttribute("alt", "new alt attr");
    $find("rttm1").tooltipify();

    where img1 is your last image and rttm1 is the RadToolTIpManager. You only need to make sure this is executed after the Sys.Application.Load event so that you can get a reference to the RadToolTipManager (it is a script control and this is the point when the object is available).

    Kind regards,
    Marin Bratanov
    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. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top