Opened 12 years ago
Closed 7 years ago
#11611 closed enhancement (patchwelcome)
Checkbox: ability to specify label field when creating programatically
Reported by: | scheid | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 1.13 |
Component: | Dijit - Form | Version: | 1.5 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
It would facilitate creating checkboxes if I could optionally specify a label field for a checkbox exactly like I do when I create a dijit.form.Button.
so, instead of having to do this:
chk = dojo.create("input", {id:"cbox", type:"checkbox"}, container); lbl = dojo.create("label", {innerHTML:"Check me", "for":"cbox"}, container); new dijit.form.CheckBox({}, chk);
I could just do this:
chk = dojo.create("input", {id:"cbox", type:"checkbox"}, container); new dijit.form.CheckBox({label:"Check Me"}, chk);
The <label> dom element would be created automatically when instantiated.
Change History (10)
comment:1 Changed 12 years ago by
Component: | General → Dijit |
---|---|
Description: | modified (diff) |
Milestone: | tbd → 1.7 |
Owner: | anonymous deleted |
Summary: | ability to specify label field for dijit.form.CheckBox when creating programatically → Checkbox: ability to specify label field when creating programatically |
comment:2 Changed 12 years ago by
This is not just from Swing developpers. Most UI toolkits I know of (Silverlight, Flex, and yes Swing) do have a label on Checkbox. Actually even in Dojo, Checkbox inherits (like in that other toolkits) from ToggleButton?. Just that inheritance scheme shows that label is highly expected...
comment:4 Changed 11 years ago by
Component: | Dijit → Dijit - Form |
---|---|
Owner: | set to Douglas Hays |
comment:5 Changed 10 years ago by
Blocking: | 12905 added |
---|
comment:6 Changed 10 years ago by
Milestone: | 1.8 → tbd |
---|
The label in ToggleButton? is different than the LABEL tag - probably just poorly named. Patches are welcome. The generated LABEL element would need to be text-direction aware.
comment:8 Changed 8 years ago by
Owner: | Douglas Hays deleted |
---|---|
Status: | new → assigned |
comment:9 Changed 8 years ago by
Status: | assigned → open |
---|
comment:10 Changed 7 years ago by
Milestone: | tbd → 1.12 |
---|---|
Resolution: | → patchwelcome |
Status: | open → closed |
Given that no one has shown interest in creating a patch in the past 5+ years, I'm closing this as patchwelcome.
Yes, this is a common request, I guess mainly coming from swing developers. destroy() would need to remove the label too. And need to decide whether "label" is rich text or plain text.