Dojo: Setting a CheckBox label programmatically
- by Mitchell Flaherty
Let me preface by saying that I saw this other question on the subject of CheckBox labels that was asked and answered well over a year ago.
I was confused by the answers and am hoping that someone can clarify or that there has been new dojo functionality introduced since then that allows me to do this without resorting to HTML.
So without further ado, I would like to know how to programmatically create labels for check boxes.
I have a check box like so:
this.pubBoxId = new dijit.form.CheckBox({
label: "IdChannel",
checked: false,
channel: that.idChannel
}, that.name + "_PBI");
As you can see I've tried to edit the "label" field, but the label never actually shows up on the page. I have multiple CheckBoxes that I am adding to a ContentPane and simply want a label to the left or right of the check box. Is there any way I can do this without having to write separate HTML?
Also, making a separate ContentPane for each individual label would be a big pain because of how many CheckBoxes I plan to have.
Thank you for reading, and let me know if further clarification is needed!