check box in TOC widget

592
1
12-05-2012 09:38 AM
Shu-RongKuo
New Contributor
Hi.

I am using the sample code TOC.  I want to check which check boxes are click to retireve the relataive attributes.  How to check which check boxes are checked ?

thanks for the help.
0 Kudos
1 Reply
danbecker
Occasional Contributor III
Hi.

I am using the sample code TOC.  I want to check which check boxes are click to retireve the relataive attributes.  How to check which check boxes are checked ?

thanks for the help.


loop over the legendLayers array which holds the serviceLayer's and check the boolean visible property.

something like this:

dojo.forEach(legendLayers, function(layer){
    if(layer.layer.visible){
        console.log('this layer is checked and turned on');
    }else{
        console.log('this layer is off');
    }
});
0 Kudos