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

Autotooltipify does not auto-update when client-side title attribute is changed

1 Answer 49 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
ADH
Top achievements
Rank 1
ADH asked on 28 Aug 2009, 03:37 PM
I'm not sure whether to call this a bug, a feature request, or just me missing something obvious and/or doing something wrong. When I auto-tooltipify a page, and then change an element's title tag via Javascript, I would generally expect RadTooltipManager to use the new, updated title tag when displaying the tooltip. It doesn't seem to, but perhaps I'm doing something wrong. Has anyone else experienced this issue? Is the only workaround the inelegant manual update via RadTooltipManager on the client side?

In case anyone else runs into this issue, this is roughly how I'm currently working around it:
objImage.title=objImage.alt; //objImage being the element in question, currently being altered by other JS 
var objTTM=$find(strTTM); //My tooltip manager
var objTooltip = objTTM.getToolTipByElement(objImage); 
objTooltip.set_content(objImage.title); 
 

If there's a better way that doesn't involve the creation of two new objects, maybe a setting I should be including on RadTooltipManager or something along those lines, I'd love to hear it - there are situations in which I do this particular call in a loop, and while I can sometimes pre-create the tooltip manager object, that's still extra overhead I'd like to see trimmed down.

Thanks!

1 Answer, 1 is accepted

Sort by
0
Accepted
Svetlina Anati
Telerik team
answered on 31 Aug 2009, 01:24 PM
Hi ADH,

The behavior you report is the expected one because of the way the autotooltipify functionality works. In brief, when the client object of the manager is created if the AutoToolTipify property is set to true, the manager iterates through all the elements with Title/ToolTip set and replaces the tooltips with RadToolTips. What you are doing is that after this code has already been executed you change the tooltip/title and the manager is not "aware" of this and does not affect the change. What you can do is to either update the manager or force it to retooltipify the page again but this is not an effective solution because if you want to change little count of elements it is not needed to iterate through all the elements on the page. That is why I recommend to stick to your solution which is the best for this particular case.


All the best,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ToolTip
Asked by
ADH
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or