Contextmenu alignment

2 posts, 0 answers
  1. Ron
    Ron avatar
    75 posts
    Member since:
    Oct 2010

    Posted 11 Jul 2017 Link to this post


    I'm not sure whether or not this has been asked but I'll ask the question nonetheless. I have a button to which I have tied a contextmenu. I would like the contextmenu to be align at the bottom of the button with the top right corner aligned to the bottom right of the button. As far as I can tell this behavior is not supported by the contextmenu API. I have managed to get a workaround working:

    This workaround is not ideal since the repositioning of the contextmenu wrapper is done in the open event and you can see the contextmenu move from the original position to the adjusted position. Is there a better way to this?



  2. Ivan Danchev
    Ivan Danchev avatar
    2135 posts

    Posted 13 Jul 2017 Link to this post

    Hi Ron,

    Indeed, except for the alignToAnchor configuration option, the ContextMenu does not expose other options or methods that would allow you to specify how exactly it should be aligned. We do not have a workaround alternative to the one you have found. Even though the logic in your fixAlignment event handler can be executed a little earlier (in the Actions div's click handler) the result is similar.

    Ivan Danchev
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top