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

Dynamicaly adding Tool tips to the links in the page

2 Answers 86 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Fuhira
Top achievements
Rank 1
Fuhira asked on 03 Jan 2008, 08:31 AM

hi ,

I have a requirement wherein I have to attach tool tips dynamically to <a> tags of HTML content.

The problem is, the Content is rendered from database and will contain many such links.

the links redirect to some other content pages like articles etc.,

for each link i have to display a tool tip which will have a brief intro about the content.

how can i do this using Radtooltip Manager. ?

I can dynamically attach the tool tip to any control using Tool tip Manager but in my case the content itself is dynamic and in that i have to fetch each link control and attach the tool tip.
hope i am clear...

is there a way in which i can invoke the tool tip from javascript function ?

help me out in this regard

Thanx in advance...,
fuhi

 

 

2 Answers, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 07 Jan 2008, 04:40 PM
Hi Fuhira,

By default, dropping a RadToolTipManager on the page will cause it to "tooltipify" all elements on the page that have a "title" attribute. Thus, if you add the "brief intro about the content" into the title attribute of each A tag, then it should work OK.

If you need to add RadToolTips selectively only to particular links, then you need not access them as object - all you need to do is assign some kind of client IDs to each link - <a href='some.href' id='link1'></a>.

Then add all relevant ID's dynamically to the RadToolTipManager TargetControlsCollection, e.g.

this

.RadToolTipManager1.TargetControls.Add("link1", true);
this.RadToolTipManager1.TargetControls.Add("link2", true);

Note - the second parameter to Add method indicates that this is a client id, not a server one.

Kind regards,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Fuhira
Top achievements
Rank 1
answered on 09 Jan 2008, 12:49 PM
hi Tervel,

I have given a title for all the <a> tags and it seems to tool tipify.

thanx
fuhi
Tags
ToolTip
Asked by
Fuhira
Top achievements
Rank 1
Answers by
Tervel
Telerik team
Fuhira
Top achievements
Rank 1
Share this question
or