AnsweredAssumed Answered

Turn off  a sublayer when button click on TOC -agsjs

Question asked by MayMay on Jul 23, 2014
Latest reply on Aug 21, 2014 by kenbuja

I download TOC here:

I want to create a button like the sample one able to turn on/off a layer.

I only able to turn on a sublayer using setVisibleLayers  method here when a button is clicked.


on(dom.byId("SetVisibleLayersProgramatically"),'click', function(evt){





But how do you turn off the same sublayer when another button is clicked?  I don't want to use toc.findTOCNode( Dynlayer, 11).hide().  It will remove the layer.  I would to uncheck the layer instead of remove the layer.


Is there any way, simple way to do this task?


Thank you.