This is a migrated thread and some comments may be shown as answers.
Contextmenu alignment
1 Answer 24 Views
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 11 Jul 2017, 12:49 PM

Hi, 

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:

http://dojo.telerik.com/aSUlI/10

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?

Greetings,
Ron

 

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 13 Jul 2017, 10:42 AM
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.

Regards,
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.
Tags
Menu
Asked by
Ron
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or