Dynamic Ajax call, get tooltip to fix it's position

4 posts, 0 answers
  1. Anthony
    Anthony avatar
    122 posts
    Member since:
    Jun 2013

    Posted 19 Sep 2014 Link to this post

    This has been asked before more or less

    http://www.telerik.com/forums/tooltip-opens-in-the-wrong-place-when-the-marker-is-clicked-and-then-corrects-itself-when-the-marker-is-clicked-a-second-time

    I have a series of Ajax calls for loading tooltips, the size will vary per call.

    I get the behaviour described in the other thread. The workaround of setting the width/height will probably work

    What would be better would be if I could initially set the tooltip to invisible, hide it, get it to fix it's position and then show it. Is this possible? It obviously knows how to fix itself once the data is loaded

    thanks
  2. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 23 Sep 2014 Link to this post

    Hi Anthony,

    I'm afraid that this is not possible. The popup used by the ToolTip widget requires the size of the container to be known when it is shown. This will ensure that the positioning as well as screen boundary detection works as expected. Therefore, it is required to explicitly set height and width options. 

    Regards,
    Rosen
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Anthony
    Anthony avatar
    122 posts
    Member since:
    Jun 2013

    Posted 23 Sep 2014 Link to this post

    When I've had similar problems in the past I'd drawn the object off screen , e.g. left: -100px, then moved it to where I want it.

    Given that the second time it appears it fixes itself there must be some refresh mechanism on the tooltip that could be called even if it means getting a flash at first?
  5. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 23 Sep 2014 Link to this post

    Hello Anthony,

    I'm afraid there is not refresh mechanism. "The self fixing" is a side effect of the fact that the popup is shared, thus the first time content is loaded, it is sized to accommodate it. Then when it is loaded it uses those dimensions for positioning, however, it the next content has totally different size the same as the initial behavior (misalignment) may be observed.

    If you don't mind the flashing of the popup you may try re-displaying it - similar to this test page. However, you may use this on your own risk as it may have unexpected behavior or not work consistently. 

    Regards,
    Rosen
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready