<?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 LayerList Widget - Turn on Sublayers in ArcGIS Viewer for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/layerlist-widget-turn-on-sublayers/m-p/109124#M3902</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a way to turn on and off all sublayers within a group within the Layer List Widget when the group is checked or unchecked?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Aug 2013 00:08:33 GMT</pubDate>
    <dc:creator>denverweston</dc:creator>
    <dc:date>2013-08-06T00:08:33Z</dc:date>
    <item>
      <title>LayerList Widget - Turn on Sublayers</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/layerlist-widget-turn-on-sublayers/m-p/109124#M3902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a way to turn on and off all sublayers within a group within the Layer List Widget when the group is checked or unchecked?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Aug 2013 00:08:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/layerlist-widget-turn-on-sublayers/m-p/109124#M3902</guid>
      <dc:creator>denverweston</dc:creator>
      <dc:date>2013-08-06T00:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: LayerList Widget - Turn on Sublayers</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/layerlist-widget-turn-on-sublayers/m-p/109125#M3903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This code turns on all the items at the parent level.&amp;nbsp; I was curious how to turn on all the layers at the child level?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var item:TocItem = TocItem(data);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; item.visible = _checkbox.selected;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; if(_checkbox.selected)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(item.isTopLevel() == false)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; item = item.parent;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; item.visible = true;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Aug 2013 11:23:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/layerlist-widget-turn-on-sublayers/m-p/109125#M3903</guid>
      <dc:creator>denverweston</dc:creator>
      <dc:date>2013-08-06T11:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: LayerList Widget - Turn on Sublayers</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/layerlist-widget-turn-on-sublayers/m-p/109126#M3904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I did something similar to expand children.&amp;nbsp; If you have one child then ask it for the parent.&amp;nbsp; Then ask the parent what other children it has.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Like this&amp;nbsp; toc.dataProvider.source&lt;I&gt;.children&lt;J&gt;.layerInfo.name&lt;/J&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Aug 2013 14:20:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/layerlist-widget-turn-on-sublayers/m-p/109126#M3904</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2013-08-06T14:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: LayerList Widget - Turn on Sublayers</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/layerlist-widget-turn-on-sublayers/m-p/109127#M3905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you do this in the TOC.itemrenderer?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I did something similar to expand children.&amp;nbsp; If you have one child then ask it for the parent.&amp;nbsp; Then ask the parent what other children it has.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;Like this&amp;nbsp; toc.dataProvider.source&lt;I&gt;.children&lt;J&gt;.layerInfo.name&lt;/J&gt;&lt;/I&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Aug 2013 16:26:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/layerlist-widget-turn-on-sublayers/m-p/109127#M3905</guid>
      <dc:creator>denverweston</dc:creator>
      <dc:date>2013-08-06T16:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: LayerList Widget - Turn on Sublayers</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/layerlist-widget-turn-on-sublayers/m-p/109128#M3906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In one version of mine i did add code to TOC.itemrender - in the createchildern function i think.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But in another version I setup a listener on the Show of a layer.&amp;nbsp; This might work best for you since you want to take action when a layer is checked (made visible).&amp;nbsp; You can set the listener for just the layers you want.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code for this is &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;layerlist&lt;J&gt;.addEventListener(FlexEvent.SHOW, mapLayerAddHandler2, false, 0, true);&amp;nbsp; &lt;/J&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;where mapLayerAddHandler2 is your function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I wanted my procedure to run whenever any layer, except basemaps, were made visible.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That code looks like this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for (var j:int = 0; j &amp;lt; layerlist.length; j++)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (toc.basemapLayers.getItemIndex(layerlist&lt;J&gt;.id) == -1)&lt;/J&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; layerlist&lt;J&gt;.addEventListener(FlexEvent.SHOW, mapLayerAddHandler2, false, 0, true);&lt;/J&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Aug 2013 16:33:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/layerlist-widget-turn-on-sublayers/m-p/109128#M3906</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2013-08-07T16:33:47Z</dc:date>
    </item>
  </channel>
</rss>

