Changing TargetControl on the client

Thread is closed for posting
1 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 23 Nov 2011 Link to this post

    A rather popular scenario when using the RadToolTip is to use a single instance on the page and utilize the onmouseover event of the  targeted elements to set a new target for the tooltip via JavaScript and show it. Generally the better approach would be to use a RadToolTip for each control or a RadToolTipManager to load content on demand, yet using a single instance reduces the markup on the page, so it is sometimes used.

    When you change a RadToolTip's TargetControl (or TargetControlID) then call its show() method since Q3 2011 you need to do so with a small timeout, e.g.:

    <input type="text" onmouseover="showToolTipNewTarget(this);" />

    <script type="text/javascript">
        function showToolTipNewTarget(newTarget) 
            var radTooltip1 = $find("RadToolTip1");
            setTimeout(function () {
            }, 20);

    If you do not use this timeout the necessary calculations cannot be performed and usually the tooltip will be shown next to the previous target.
Back to Top