AnsweredAssumed Answered

Listening to a checkbox

Question asked by kenbuja on Oct 17, 2017
Latest reply on Oct 17, 2017 by kenbuja

I'm adding a checkbox on my widget that turns labels on or off on a particular layer. However, it doesn't respond to the click event "showCoinLabels" as defined in data-dojo-attach-event

 

<div data-dojo-type="jimu/dijit/CheckBox" data-dojo-attach-point="chkCoinLabels" style="margin-top: 5px;" data-dojo-attach-event="onClick: showCoinLabels"></div><label class="jimu-leading-margin05">Show Coin Labels</label>

 

If I substitute a jimu-btn, that will fire the event

<div data-dojo-attach-point="btntest" id="chkCoinLabels" class="jimu-btn apply" data-dojo-attach-event="onclick:showCoinLabels" style="margin-top: 10px">Show Coin Labels</div>

 

I've also tried using a regular data-dojo-type="dijit/form/CheckBox", as used in the Analysis widget Setting.html, with no luck. What's the proper way to add a checkbox?

Outcomes