Login Register

ContextMenu

Trouble with dynamically created dijit.Menu and leftClickToOpen

I'm having trouble dynamically creating a dijit.Menu that opens with a left mouse button click. I have been successful dynamically creating a dijit.Menu that opens with a right mouse button click. I have also been successful declarative creating a dijit.Menu that opens with a left mouse button click.

I've include with this post some HTML that duplicates what works and what doesn't. The behavior of the HTML is the same in IE 6, FF 2/3, and Chrome. Hopefully, it will be simple to get up and running. Once it's running try the following...

Enabling Context Menu for selected nodes in a tree

Iam trying to setup a ContextMenu for a dijit Tree where the menu pops up only for certain
nodes of the tree. Iam using the targetNodeIds attribute of the ContextMenu properties
to set the menu for the tree. Iam unable to capture the detail of which node triggered the
event in FireFox. In IE, Iam able to use the inbuilt event object.
Iam not sure why Iam not able to read the "event" argument passed as a parameter to the
onOpen method of the ContextMenu widget. when I tried alert-ing evt.target in FF, i get

Context Menu in IE cause everything hide

Dojo support a lot of context menus, but my application has error with that in IE (everything is ok with FF). The problem is that when I click the right button to show the menu, the menu itself is ok, but all the other things disappeared leaving the background image of the BODY until next click (no matter left or right button).
This problem seems to be related with the CSS of the BODY. The css of BODY is like this:

body {
background: url(../images/bg1024.JPG) no-repeat;
width:1024px;
height:768px;
}

Syndicate content