Welcome Guest Search | Active Topics | Sign In | Register

Manual Show Context Menu Options
DanJ1980
Posted: Tuesday, July 27, 2010 2:10:56 PM
Rank: Newbie
Groups: Member

Joined: 7/27/2010
Posts: 5
Hello,

I would like to link a context menu to a button so that when the user clicks the button, the context menu shows below it.

I'm going to label the button "Add New" and the context menu will be used to select from a few different types of items.

I was wondering how I can manually cause the contextmenu to show and be displayed below (or near) the "Add New" button.

Thanks
eo_support
Posted: Tuesday, July 27, 2010 2:49:54 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You will need to call this function:

http://doc.essentialobjects.com/library/1/jsdoc.public.global.eo_showcontextmenu.aspx

You can call it from anywhere, for example, from your button's onclick handler:

Code: HTML/ASPX
<input type="button" 
onclick="eo_ShowContextMenu(event, 'Menu1');" value="Test" />


Note you must replace "Menu1" with the ID of your context menu control.

Thanks!
DanJ1980
Posted: Tuesday, July 27, 2010 3:16:23 PM
Rank: Newbie
Groups: Member

Joined: 7/27/2010
Posts: 5
Thanks, that worked.

However, how can I position the context menu?
eo_support
Posted: Tuesday, July 27, 2010 3:18:29 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You don't position it. The first parameter you pass to eo_ShowContextMenu is the DOM event object. It supposes to contain information about where your mouse is. The context menu is then automatically positioned based on your mouse position.

Thanks
DanJ1980
Posted: Tuesday, July 27, 2010 4:31:28 PM
Rank: Newbie
Groups: Member

Joined: 7/27/2010
Posts: 5
You are correct that it is getting the event object from the mouseclick, however the location of the context menu isnt correct.

Its appearing much further up the screen.
DanJ1980
Posted: Tuesday, July 27, 2010 4:32:21 PM
Rank: Newbie
Groups: Member

Joined: 7/27/2010
Posts: 5
Actually, the positioning problem only occurs in firefox.

Any ideas?
Thanks
eo_support
Posted: Tuesday, July 27, 2010 4:48:57 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We are not aware of such problem. Please try to isolate the problem into a test page, we will be happy to take a look as soon as we have that.

Thanks!
DanJ1980
Posted: Wednesday, July 28, 2010 5:52:18 AM
Rank: Newbie
Groups: Member

Joined: 7/27/2010
Posts: 5
Hi, I have an example document.

How can I send it to you?

Thanks
Dan
eo_support
Posted: Wednesday, July 28, 2010 9:53:07 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Please check what version you are using. We received your sample page and tested it with the latest version and it works fine on FireFox.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.