#7111 closed task (fixed)
Menu: handle many events with the menu - rather than menu items
Reported by: | Nathan Toone | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.8 |
Component: | Dijit | Version: | 1.1.1 |
Keywords: | Cc: | alex | |
Blocked By: | Blocking: |
Description
Alex suggested that we handle events in the menu widget rather than having them all on the menuItem widgets themselves.
We should replace the onClick and onMouseEnter/onMouseLeave functions on dijit.MenuItem? with corresponding functions on dijit.Menu
Attachments (1)
Change History (17)
comment:1 Changed 13 years ago by
Summary: | dijit.Menu: handle many events with the menu - rather than menu items → Menu: handle many events with the menu - rather than menu items |
---|
comment:2 Changed 13 years ago by
Owner: | changed from nathan to Nathan Toone |
---|
comment:3 Changed 13 years ago by
Reporter: | changed from nathan to Nathan Toone |
---|
comment:4 Changed 13 years ago by
Milestone: | → 2.0 |
---|
comment:6 Changed 9 years ago by
This should be easier w/the event delegation in dojo/on, except that it's broken for <tr>; I filed #14509 .
comment:8 Changed 9 years ago by
Milestone: | 2.0 → 1.8 |
---|---|
Owner: | set to bill |
Status: | new → assigned |
Type: | enhancement → task |
comment:13 Changed 9 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Reopening as reminder to change it to pass a function to on.selector() rather than ".dijitMenuItem", to eliminate dojo/query dependency. But waiting on answer to #14575 first.
If I end up using ".dijitMenuItem", then need to put dojo/query in the dependency list.
Note: See
TracTickets for help on using
tickets.
We can't remove MenuItem.onClick() because it would break backwards compatibility. At least not until 2.0.
It might be possible to have a callback on Menu in addition to the one on MenuItem, and that's what Menu.onItemClick() basically is, and also Menu.onExecute().
However, this is tricky to really have work. Menus can contain multiple subwidgets, not just MenuItem but also ColorPicker, !Calendar (except right now that breaks a11y)... I think it might even be possible to have a TooltipDialog but I'd need to test.
Anyway, this is something I thought about during the design of Menu and there's a reason it works the way it does now.