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

client-side RadToolTip set_Position() problem

1 Answer 178 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
craig
Top achievements
Rank 1
craig asked on 18 May 2009, 08:52 PM
    I'm currently having a problem using the RadToolTip (not the manager).  When I create my tooltip on the server, I assign the 'OnClientBeforeShow' property to a client side function.  This function will then call the 'set_Position()' function of the client-side API.

    However, there seems to be some problem with doing this here...  The only way the client-side code has any effect on the tooltip position is if I apply an animation to it.  However, I would like to show the tooltip w/o animation.  Example:
    If I put a 'fade' animation on the tooltip, the tooltip will show (fading in), center itself, then go to the bottom-right position.  This   appears very jumpy.  It seems like the 'fade' animation also does not take into account the default position set on the server-side.  It seems like the position is set after a lot of other things have taken place.

Thanks

Here is the server and client side code:

Server-side code:

 
Me.EnableEmbeddedSkins = False   
Me.Animation = Telerik.Web.UI.ToolTipAnimation.None   
Me.ContentScrolling = Telerik.Web.UI.ToolTipScrolling.None   
Me.HideDelay = 5000   
Me.Position = Telerik.Web.UI.ToolTipPosition.BottomRight   
Me.RelativeTo = Telerik.Web.UI.ToolTipRelativeDisplay.Element   
Me.ShowDelay = 350   
Me.ShowCallout = False   
Me.Sticky = True   
Me.HideEvent = Telerik.Web.UI.ToolTipHideEvent.LeaveToolTip   
Me.OnClientBeforeShow = "Tooltip_OnBeforeShow" 
 
 
Client-side:  
    
function Tooltip_OnBeforeShow(sender, eventArgs) {   
   
var intPosition, intWidth, intHeight;   
intHeight = document.body.offsetHeight;  
intWidth = document.body.offsetWidth;  
 
if (sender._mouseY <= (intHeight / 3))   
{  
  intPosition = 30;  
}  
else if ((sender._mouseY <= (intHeight / 3) * 2))   
{  
  intPosition = 20;  
}  
else if ((sender._mouseY > (intHeight / 3) * 2))   
{  
  intPosition = 10;  
}  
 
if (sender._mouseX <= (intWidth / 2))   
{  
  intPosition += 3;  
}  
else if (sender._mouseX > (intWidth / 2))   
{  
  intPosition += 1;  
}  
 
sender.set_position(intPosition);   
}  

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 21 May 2009, 11:00 AM
Hi Craig,

I build up a test demo based on your code but I was not able to reproduce the problem - please examine the attached demo. If you comment the line which sets the position on the client, the tooltip will show at bottom right as set in the code behind. However, if you uncomment this line, the tooltip will show at the middle right due to your script.

In case you still experience the problem, please provide more detailed explanations and reproduction steps.

Sincerely yours,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
ToolTip
Asked by
craig
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or