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

Show delay not being honoured when showing via client side

6 Answers 56 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Davoc Bradley
Top achievements
Rank 1
Davoc Bradley asked on 17 Dec 2010, 01:59 PM
Hi,

I'm using a webservice to populate my tooltip, which means I'm having to call it via javascript.  The show delay is not honoured when I do this.  How do the rad controls implement this, as they must fire the even client side, what event is used to perform this action please?  Using showtootip means I would have to write some horrible code to perform a show delay, and I would rather not do that if possible.

Cheers,

Davoc

6 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 20 Dec 2010, 10:05 AM
Hello Davoc Bradley,

 Indeed, I can confirm that when having ShowDelay set, it is not respected if the tooltip is shown by the client-side show() method and this is by design (the same for HideDelay and hide()) because when the user calls show() (hide()) it is expected that the action happens immediately. The user has the ability to show the tooltip whenever he wants and also using the setTimeout function is a really simple manner to achieve the same result as using ShowDelay. Note also that if you want to programmatically show a tooltip, you should set ShowEvent="FromCode".

Greetings,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Davoc Bradley
Top achievements
Rank 1
answered on 20 Dec 2010, 10:13 AM
Hi Svetlina,

When using settimeout it achieves a totally different result to using show delay, as with the show delay the tooltip will not show if the mouse overed control which invoked the open is no longer mouse overed, however the settimeout function will open the tool tip whatever, just with a slight delay.  Do you have any other suggestions?

Cheers,

Davoc
0
Svetlina Anati
Telerik team
answered on 20 Dec 2010, 03:18 PM
Hi Davoc,

I am not completely sure what is the exact scenario you want to achieve and why you need to use show() instead of setting the properties you mentioned. The idea behind the show() method is to provide full control to the developer so that he can implement a custom fine - tuned scenario. Implementing that scenario, however, is the developer's task and can be done by using general javascript.

What I can suggest in your case is the following:

1) Use the setTimeout method as already suggested with the desired show delay value
2) Attach a handler to onmouseout event of the target control and set some flag there
3) Handle the tooltip's OnClientBeforeShow event and check the flag from 2) there; if it is set, the mouse has left the target and you can cancel the show by using the args.set_cancel(true) syntax; clear the flag;

I hope that my suggestion is helpful, let me know how it goes.

 Regards,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Davoc Bradley
Top achievements
Rank 1
answered on 20 Dec 2010, 03:24 PM
Hi Svetlina,

The issue we were having was that the tooltips were taking a long time to load because it fires all the serverside page events, which causes the whole page to be reloaded to show just the tool tip.  We decided to implement tooltips which get their data from a webservice, which mades them almost instantanious when loading now.  As far as I was aware, there is not the ability to use the server side events when creating tooltips in this method?

The issue with implementing the fix you have suggested is that within our surrounding div within the tool tip there are several div's, and when mousing into these other div's it fires the mouseout event for the surrounding div, so would cancel the tool tip, despite the mouse still being within one of the outer div's inner controls.

Cheers,

Davoc
0
Svetlina Anati
Telerik team
answered on 23 Dec 2010, 01:14 PM
Hi Davoc Bradley,

 Straight to your questions:


1) As far as I understand you want to show the tooltips on mouse over - in this case you can simply use the ShowEvent property. Your observations about the WebService are correct but you can still populate the TargetControls collection and this will cause the tooltip manager to dynamically create tooltips so that you do not need to create and show it programmatically. A sample demo which uses WebService and the TargetControls collection is available below:

http://demos.telerik.com/aspnet-ajax/tooltip/examples/webservice/defaultcs.aspx

2) You can stick to the approach you have used and resolve the event bubbling by canceling it. Event bubble can be canceled through javascript and there are solutions on the net. What I recommend is to use one of our methods which cancels event bubbling and is cross browser which is as shown below:

$telerik.cancelRawEvent(e)

where e is the event.

I hope that my reply is helpful, let me know if you need further assistance.

Regards,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Davoc Bradley
Top achievements
Rank 1
answered on 23 Dec 2010, 02:12 PM
Thanks, that's great!  Have a merry Christmas!
Tags
ToolTip
Asked by
Davoc Bradley
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Davoc Bradley
Top achievements
Rank 1
Share this question
or