Setting ShowDelay has no effect

4 posts, 0 answers
  1. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 25 Jul 2011 Link to this post

    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

  2. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 25 Jul 2011 Link to this post

    <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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 25 Jul 2011 Link to this post

    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
  5. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 25 Jul 2011 Link to this post

    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!

Back to Top