Ticket #6226 (closed enhancement: wontfix)
Menu: API enhancements
| Reported by: | alex | Owned by: | bill |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.4 |
| Component: | Dijit | Version: | 1.0 |
| Severity: | normal | Keywords: | menu, dijit |
| Cc: |
Description (last modified by bill) (diff)
I've been working with dijit.Menu this evening, and it's really making me scratch my head about a couple of design choices.
First, there's no open() or close() methods. Instead, one must pass an instance of the Menu into dijit.popup.open() or dijit.popup.close(). This is (to say the least) unintuitive.
Secondly, I expect that menus will be re-used often, and while there's a programmatic example of adding items to a menu, no example is provided for how to remove them, nor is there a "clear()" method or similar for removing dijit.MenuItem?() instance. Similarly, there isn't a uniform "remove from parent" (not destroy()) method on MenuItem? instances.
Lastly, it would seem that the construction of a set of menu items is the common case. Supporting a JSON-style syntax for describing a set of items and their generic properties seems useful for constructing trees of menus.