Make legend more like table of contents

Discussion created by jdkitzmi on Dec 20, 2011
Latest reply on Dec 20, 2011 by jdkitzmi
Ive seen the sample to add a legend and the sample to toggle layer visability. Is there a way to combine the two and make the legend more like the table of contents in ArcMap/ArcServer to toggle the layers? I'm fairly new to JavaScript so if its too complicated, I can work on this aspect later. Thanks.