Recenter tooltip from javascript.

4 posts, 0 answers
  1. NaturalCause
    NaturalCause avatar
    8 posts
    Member since:
    Mar 2010

    Posted 11 May 2010 Link to this post

    When displaying the information is loaded from an ajax request, sometimes the information can be longer than usual, so i would like to re-position the tooltip.

    How can i re-position the tooltip after its being displayed?

  2. Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 12 May 2010 Link to this post

    Hello Phillip Haydon,

    By design RadToolTip will be automatically repositioned if it goes out of the visible area.
    In case that you want to reposition the tooltip once it is opened you can use the following JavaScript code:
    var popupBehavior = Telerik.Web.UI.RadToolTip.getCurrent().get_popupElement().PopupBehavior;
                popupBehavior.set_x(200);
                popupBehavior.set_y(200);

    Let us know if you have any other questions.

    Greetings,
    Petio Petkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. NaturalCause
    NaturalCause avatar
    8 posts
    Member since:
    Mar 2010

    Posted 11 Jul 2010 Link to this post

    Hey,

    Didn't realise there was a reply to my question.

    This doesn't exactly work as expected. If I open the tooltip as a modal, and the data changes after opening. expanding the height/width of the popup, just setting the x/y cords doesn't help position the modal in the correct place.

    To recenter it I ended up using jQuery to get the Height/Width of the wrapper.

    Set the top/left position to 50%.

    Set the margin-top/margin-left to negative half the height/width of the wrapper.

    This re-centers the popup correctly. This feature should be built in by default tho. I should be able to call tooltop.recenter(); and it does this for me.

  5. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 14 Jul 2010 Link to this post

    Hi NaturalCause,

    I tried to reproduce the problem you report but unfortunately to no avail - would you please share some relevant reproduction code which is fully runnable here? If we succeed to reproduce the problem and indeed we verify the validity of the scenario we will consider improving this behavior in the source code and we will also add some Telerik points for your kind cooperation.

    Greetings,
    Svetlina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top