Select to view content in your preferred language

listen to event based on met criteria

2059
10
Jump to solution
03-06-2017 01:00 PM
LefterisKoumis
Frequent Contributor

I have a number of check boxes that users can click on to activate a layer on each checkbox. After a number of check boxes  clicked, I would like to capture the click event but not check the checkbox (stop any further actions), and inform the user that the max number of boxes is reached. If the user deselect a checkbox, then the functionality is restored again.

Suggestions? Thanks.

this.own(on(layerCheckbox.domNode, 'click', lang.hitch(this, function(){

   if (numberofcheckboxes >5) //criteria met

   {

    --------------

   } else {

})

0 Kudos
10 Replies
LefterisKoumis
Frequent Contributor

I  resolved the situation by using:

 registry.byId(mycheckbox).setValue(false);

I don't know why the 

 registry.byId(mycheckbox).set("checked", false)

does not work.

0 Kudos