Hi,
I am using Web context menu to show some items. The menu is shown just before the right corner of the screen. So some part of menu text is not visible. This is because the menu is always shown to the right of mouse pointer. Can we have the context menu to display on the left side of the pointer when there is not enough space on the right side.
Please let me know how to resolve this.
Thanks in advance.
Hi Tsvetelina,
Please let me know if you need any additional info on this issue.
Thanks.
Thanks for the quick reply. But I am already using the showAt method. I want to know how can I show my menu to the left of my pointer when there is not enough space to show menu on right.
I have tried both these methods:
oMenu.showAt(null, null, event); oMenu.showAt(event.pageX, event.pageY, null);
Both variations do not show menu on left when no space on right side of screen. When there is no space, IE's horizontal scrollbar appears to fully view the menu. I dont want this - the window should not be resized and menu should appear on left.
And the width property I could find was: oMenu._menuGroupSettings._element.offsetWidth. This gives correct value the first time menu is shown. But when I add/remove items on client side, then it returns value of 0. Similar is the case with oMenuItem.get_element().offsetWidth.
I add/remove items on client side using idea from another post where I initialize menu with 20 items, then set the display attribute to 'block' or 'none' of individual menu items as required. Then just before calling showAt method, I try to get the width. But it returns correct value the first time, then it always returns 0.
Thanks a lot.
Hello ,
Thank you for posting in Infragistics forums.
You can use width property of the MenuGroup
http://help.infragistics.com/NetAdvantage/ASPNET/2011.2?page=WebDataMenu~Infragistics.Web.UI.DataMenuGroupSettings_members.html
You can also use the showAt method
http://help.infragistics.com/NetAdvantage/ASPNET/2011.2?page=WebDataMenu~Infragistics.Web.UI.WebDataMenu~showAt.html
Please let me know if you need further assistance
Alternatively, can I get the total width of my menu on client side. I dynamically add/remove items in my menu.