<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: TOC check/uncheck box in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-check-uncheck-box/m-p/307906#M28259</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Sep 2014 17:22:34 GMT</pubDate>
    <dc:creator>MayJeff</dc:creator>
    <dc:date>2014-09-15T17:22:34Z</dc:date>
    <item>
      <title>TOC check/uncheck box</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-check-uncheck-box/m-p/307904#M28257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I download TOC from this site:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109" title="http://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109"&gt;http://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109&lt;/A&gt; .&lt;/P&gt;&lt;P&gt;When FeatureLayer 1 off, I want to turn on sublayer 3; otherwise set it back to default setting.&amp;nbsp; Here is JSFiddle:&lt;A href="http://jsfiddle.net/MayJeff00/1qqkhzhb/" title="http://jsfiddle.net/MayJeff00/1qqkhzhb/"&gt;Edit fiddle - JSFiddle&lt;/A&gt;&amp;nbsp; but all the check box for sublayers not able to check or uncheck anymore. Layers show up correctly.&amp;nbsp; Is there possible to perform this task?&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="flon.gif" class="jive-image image-1" height="330" src="https://community.esri.com/legacyfs/online/12556_flon.gif" width="241" /&gt;&lt;IMG alt="floff.gif" class="jive-image image-2" height="334" src="https://community.esri.com/legacyfs/online/12563_floff.gif" width="239" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2014 14:39:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-check-uncheck-box/m-p/307904#M28257</guid>
      <dc:creator>MayJeff</dc:creator>
      <dc:date>2014-09-15T14:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: TOC check/uncheck box</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-check-uncheck-box/m-p/307905#M28258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your issue is that any click in the TOC is handled by the 'toc-node-checked' event. In your event, regardless of what layer you click on (whether it's a root layer or sublayer), you're always setting the visibility of dynaLayer1. You have to determine if the user is clicking on the featLayer1 layer, then set the visibility of dynaLayer1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14107985802752903" jivemacro_uid="_14107985802752903" modifiedtitle="true"&gt;
&lt;P&gt;//try to set layer visibility based on feature layer on/off -------------&lt;/P&gt;
&lt;P&gt;if (evt.rootLayer == featLayer1) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if (featLayer1.visible == false) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dynaLayer1.setVisibleLayers([3]);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; else {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dynaLayer1.setVisibleLayers([2, 5, 8, 11]);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've updated your &lt;A href="http://jsfiddle.net/kenbuja/1qqkhzhb/1/"&gt;Fiddle&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2014 16:31:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-check-uncheck-box/m-p/307905#M28258</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2014-09-15T16:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: TOC check/uncheck box</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-check-uncheck-box/m-p/307906#M28259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2014 17:22:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-check-uncheck-box/m-p/307906#M28259</guid>
      <dc:creator>MayJeff</dc:creator>
      <dc:date>2014-09-15T17:22:34Z</dc:date>
    </item>
  </channel>
</rss>

