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

Setting ShowDelay has no effect

3 Answers 59 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Stuart Hemming
Top achievements
Rank 2
Stuart Hemming asked on 25 Jul 2011, 12:21 PM
I have a page with a tooltip on it defined thus...
<telerik:RadToolTipManager runat="server"
                           ID="RadToolTipManager1"
                           OffsetX="0"
                           OffsetY="0"
                           ShowDelay="5000"
                           HideDelay="500"
                           Width="320"
                           Height="210"
                           Animation="None"
                           Text="Loading..."
                           RelativeTo="Element"
                           OnAjaxUpdate="RadToolTipManager1_AjaxUpdate"
                           OnClientBeforeShow="FolderTreeToolTipBeforeShow"
                           EnableShadow="true"
                           HideEvent="LeaveTargetAndToolTip"
                           AutoCloseDelay="10000" />
It doesn't matter what I set ShowDelay to, the tooltip shows as soon as I hover over it.

Pourquoi?

-- 
Stuart

3 Answers, 1 is accepted

Sort by
0
Stuart Hemming
Top achievements
Rank 2
answered on 25 Jul 2011, 12:49 PM
<sigh/>

OK, I think I know why the delay isn't working.

The tooltip is triggered by a client-side mouseover event...
if (!tooltip)
{
    tooltip = tooltipManager.createToolTip(node);
    tooltip.set_value(nodeElem.get_attributes().getAttribute("iid"));
    tooltip.show();
}

I'm guessing that .show() doesn't honour the ShowDelay value.

-- 
Stuart
0
Stuart Hemming
Top achievements
Rank 2
answered on 25 Jul 2011, 12:59 PM
This is odd.

If I start the page and hover over a node, the tooltip shows straight away. This is true for any node on the treeview that I've not hovered over this session.

However, if I revisit a node, the there is a delay before the tooltip is displayed.

-- 
Stuart
0
Svetlina Anati
Telerik team
answered on 25 Jul 2011, 03:39 PM
Hello Stuart,

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.


This being said, in order to get the desired result you should modify use code e.g similar to the following:

if (!tooltip)
  
{
  
    tooltip = tooltipManager.createToolTip(node);
  
    tooltip.set_value(nodeElem.get_attributes().getAttribute("iid"));
 
setTimeout(function(){
  
    tooltip.show();}, 5000);
  
}

 

The above code is equal to ShowDelay="5000". Note, also, that if you want to programmatically show a tooltip, you should also set ShowEvent="FromCode".

 I hope that my reply is detailed enough and helpful, let me know if any additional questions arise.

Regards,
Svetlina
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
ToolTip
Asked by
Stuart Hemming
Top achievements
Rank 2
Answers by
Stuart Hemming
Top achievements
Rank 2
Svetlina Anati
Telerik team
Share this question
or