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

How to change the RadToolTip text in JavaScript?

2 Answers 58 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 25 Jan 2011, 05:02 PM
Summary
I want a way to change the text of a RadToolTip using JavaScript.

In Detail
I have an ASP.NET page that contains a "DataGrid" (actually, it's one of our own controls, but that's largely irrelevant).

In the ItemTemplate, we define the "row".  One of the elements in the Row is a RadToolTip.

However, what we need displayed here (simple text) takes too long to work out when the page is initially loading.

The User has to click on a button to say they want the data and this button causes an Ajax callback.

This callback "panel" does not contain the datagrid.

The result of the callback lets me know the text for every single RadToolTip Control on the page - each one has its own unique text.

So, within a JavaScript function, I then have (for each RadToolTip on the page):
  • The clientID for the RadToolTip (which is a div, the inner input has the same clientId, suffixed with "_ClientState"
  • The text for the RadToolTip to display
So...the question is how can I change the text from my JavaScript function?

I do note that the text is actually controlled by the following:

Sys.Application.add_init(function() {
239 $create(Telerik.Web.UI.RadToolTip, {"_cssClass":"","_manualCloseButtonText":"Close","clientStateFieldID":"ctl00_cph1_browser_products_products_products_Repeater_ctl02_itemIconTooltip_ClientState","formID":"aspnetForm","relativeTo":1,"skin":"Default","targetControlID":"ctl00_cph1_browser_products_products_products_Repeater_ctl02_itemIcon","text":"Text to display"}, null, null, $get("ctl00_cph1_browser_products_products_products_Repeater_ctl02_itemIconTooltip"));
240});

Thanks in advance

Griff

2 Answers, 1 is accepted

Sort by
0
Accepted
Cori
Top achievements
Rank 2
answered on 26 Jan 2011, 02:06 PM
Hello Jonathan,

You can refer to this help topic to find out the js functions available to the RadToolTip control:

http://www.telerik.com/help/aspnet-ajax/tooltip_clientradtooltip.html

The method you're looking for would be set_text() or set_content().

I hope that helps.
0
Jonathan
Top achievements
Rank 1
answered on 26 Jan 2011, 02:25 PM
Excellent - many thanks.
Tags
ToolTip
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Jonathan
Top achievements
Rank 1
Share this question
or