How to change the RadToolTip text in JavaScript?

3 posts, 1 answers
  1. Jonathan
    Jonathan avatar
    6 posts
    Member since:
    Dec 2010

    Posted 25 Jan 2011 Link to this post

    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. Answer
    Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 26 Jan 2011 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jonathan
    Jonathan avatar
    6 posts
    Member since:
    Dec 2010

    Posted 26 Jan 2011 Link to this post

    Excellent - many thanks.
Back to Top