Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4998 closed defect (invalid)

Toolbar menu item events

Reported by: guest Owned by:
Priority: high Milestone:
Component: Dijit Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

In the attached file, the event function, the function gets called, but I don't know how to retrieve the event source from the event. Also, how do you subscribe to events generated by a menuItem or any other event emiting source?

And there is little or no documentation on this, either in the tests or elsewhere. All the docs appear to approach the problem from a general point of view. The devil is in the details guys.

Attachments (2)

dijitTestToolbarDropDownButton.html (3.2 KB) - added by guest 12 years ago.
4998.html (2.5 KB) - added by bill 12 years ago.
working example using onClick

Download all attachments as: .zip

Change History (9)

Changed 12 years ago by guest

comment:1 Changed 12 years ago by bill

What do you mean by "the event source"?

By the way, it would be easier if you just did:

var menuItem1 = new dijit.MenuItem({
  label: "Save",
  onClick: foobar
});

comment:2 in reply to:  1 Changed 12 years ago by guest

Replying to bill:

What do you mean by "the event source"?

By the way, it would be easier if you just did:

var menuItem1 = new dijit.MenuItem({
  label: "Save",
  onClick: foobar
});

I've tried that and unless I am missing something, it does not work.

comment:3 Changed 12 years ago by guest

Check it out. That is the obvious solution and maybe I am not doing something, but that syntax does not invoke the foobar function.

comment:4 Changed 12 years ago by guest

var menuItem1 = new dijit.MenuItem({
	         id:"menuItem1",		                	
                 label: "Save",
                 onClick:foobar,	
                 iconClass:"dijitEditorIcon dijitEditorIconSave"
                 document.createElement("div"));

Nothing happens. That is why I chose the other methodology.

comment:5 in reply to:  4 Changed 12 years ago by guest

Replying to guest:

var menuItem1 = new dijit.MenuItem({
	         id:"menuItem1",		                	
                 label: "Save",
                 onClick:foobar,	
                 iconClass:"dijitEditorIcon dijitEditorIconSave"
                 document.createElement("div"));

Nothing happens. That is why I chose the other methodology.

By event source I mean: which menuItem generated the event? When I try to find it by dojo.byId("menuItem2"), it doesn't get the menuItem. I have tried looking for it in the MouseEvent??, and it does not come up?

Changed 12 years ago by bill

Attachment: 4998.html added

working example using onClick

comment:6 Changed 12 years ago by bill

Resolution: invalid
Status: newclosed

I attached an example using onClick.

comment:7 Changed 12 years ago by bill

(In [11362]) Add example of programmatic dropdown button creation. Refs #4998.

Note: See TracTickets for help on using tickets.