#5960 closed task (fixed)
add DropDownButton.setDropDown() method
Reported by: | guest | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | Dijit - Form | Version: | 1.0 |
Keywords: | Cc: | alex, [email protected]… | |
Blocked By: | Blocking: |
Description (last modified by )
Tested in version 1.0.1. This bug is reproducable.
Given:
var toolbar = new dijit.Toolbar(); var button = new dijit.form.DropDownButton({ label: 'Button Label' }); var menu = new dijit.Menu(); var menuitem = new dijit.MenuItem({ label: 'Menu Item' });
It should be possible to create an desktop-application-like menubar like so:
toolbar.addChild( button ); button.addChild( menu ); menu.addChild( menuitem );
But this does not work.
Instead of calling button.addChild(), you must directly set button's .dropDown property like so:
button.dropDown = menu;
This appears to be a defect.
If DropDownButton.addChild() is inappropriate for this action, perhaps DropDownButton.addDropDown() would be correct.
Bug filed by teatime <[email protected]…> at the request of slightlyoff from irc://irc.freenode.net/#dojo
Change History (8)
comment:1 Changed 13 years ago by
Cc: | alex [email protected]… added |
---|---|
Milestone: | → 1.2 |
comment:2 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:3 Changed 13 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
bill:
even if addChild is designed to do something different, there should be an addPopup or setDropDown() method on the dropDownButton.
comment:4 Changed 13 years ago by
Description: | modified (diff) |
---|---|
Milestone: | 1.2 → 1.4 |
Summary: | Adding Menu to DropDownButton via. addChild() fails, must set .dropDown property directly → add DropDownButton.setDropDown() method |
Type: | defect → task |
OK, not sure what the advantage of a method would be beyond setting that property directly. Perhaps there's some additional book keeping it needs to do.
comment:5 Changed 12 years ago by
Milestone: | 1.4 → 1.5 |
---|
bumping 1.4 tickets to 1.5, and most 1.3 tickets to 1.4
comment:6 Changed 11 years ago by
Milestone: | 1.5 → 1.6 |
---|
comment:7 Changed 11 years ago by
Milestone: | 1.6 → 1.4 |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
This is working in 1.4 via the standard widget API of:
dijit.byId("color").attr("dropDown", new dijit.Calendar({}))
and then in 1.5 by using set() rather than attr().
Might even be working before 1.4, not sure, but anyway marking as fixed in 1.4.
comment:8 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|
No, it's working as designed. addChild() is more for the case where you can have any number of children (including zero)... not this case where there is a one-to-one mapping.