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

TargetControlId appears to be lost when dynamically updating position

1 Answer 88 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
mc2000
Top achievements
Rank 1
mc2000 asked on 08 Oct 2010, 04:35 PM
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.

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 12 Oct 2010, 09:16 AM
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
Tags
ToolTip
Asked by
mc2000
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or