TargetControlId appears to be lost when dynamically updating position

2 posts, 0 answers
  1. mc2000
    mc2000 avatar
    48 posts
    Member since:
    Nov 2009

    Posted 08 Oct 2010 Link to this post

    Consider the following JavaScript code

        var radToolTip = $find(toolTipClientId);
       radToolTip.set_targetControlID("");     // Fix provided by Telerik b/c target control id is list in update panel
       radToolTip.set_targetControlID(sender.id);
       if (getMousePosition() > (getWindowHeight() / 2)) { radToolTip.set_position(Telerik.Web.UI.ToolTipPosition.TopRight); }
       else { radToolTip.set_position(Telerik.Web.UI.ToolTipPosition.BottomRight); }
       radToolTip.show();

    I recently made a change where I calculate the mouse position and the window position to say (semantically), if the user has clicked on a link on the bottom of the window, set the position of the tooltip to the upper right else set the position to the lower right. It appears to work at first glance, with the tooltip popping up correctly. However, after a couple of clicks, it appears as though the tooltip is losing it's target control ID. For example, the tooltip will pop up in the right direction, just on the existing control ID (link). If I take out the position code it works fine but always has the tooltip on the bottom which causes users to scroll. I've really been scratching my head on this so any help is appreciated.
  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 12 Oct 2010 Link to this post

    Hello mc2000,

     I am afraid I could not completely understand the issue. You say that "However, after a couple of clicks, it appears as though the tooltip is losing it's target control ID. For example, the tooltip will pop up in the right direction, just on the existing control ID (link)"  and if the target control id is lost, the tooltip will not show at all. As far as I understand the issue is related to position and not to target control and this might be a result of the dynamic repositioning the tooltip has which might make things look as the target control is changed. However, in order to help I will really need some sample code which is fully runnable along with detailed reproduction instructions and explanations of the actual and the desired result and once I have a better understanding on the issue along with reproduction code on my side, I will do my best to help.

    Sincerely yours,
    Svetlina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top