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

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

3 Answers 173 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Anthony
Top achievements
Rank 1
Anthony asked on 19 Sep 2014, 07:00 AM
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

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 23 Sep 2014, 10:43 AM
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!
 
0
Anthony
Top achievements
Rank 1
answered on 23 Sep 2014, 10:51 AM
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?
0
Rosen
Telerik team
answered on 23 Sep 2014, 11:55 AM
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!
 
Tags
ToolTip
Asked by
Anthony
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Anthony
Top achievements
Rank 1
Share this question
or