<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Courier New" size="2">
<div> I'm sure this can be done but I'm having a hell of a time accomplishing this. I need to know which childnode has been clicked from my layerNode (which is added to a layertree root node). Except I am using grouped layers through openlayers so I am having
a hard time pulling out the name of one of these child nodes. Is there any event I can add to the below code to tell me the name of the childnode when it is clicked and not the root node? Appreciate any advice.</div>
<div> </div>
<div><font color="#008000"> //AOIs layerList</font></div>
<div> layerList_AOIs = <font color="#0000FF">new</font> GeoExt.tree.LayerNode({</div>
<div> <font color="#A31515">"layer"</font>: layer_AOIs,</div>
<div> <font color="#A31515">"isLeaf"</font>: <font color="#0000FF">true</font>,</div>
<div> <font color="#A31515">"preloadChildren"</font>: <font color="#0000FF">true</font>,</div>
<div> <font color="#A31515">"checked"</font>: <font color="#0000FF">false</font>,</div>
<div> <font color="#A31515">"enableDD"</font>: <font color="#0000FF">true</font>,</div>
<div> <font color="#A31515">"cls"</font>: <font color="#A31515">"rootnode"</font>,</div>
<div> <font color="#A31515">"singleClickExpand"</font>: <font color="#0000FF">true</font>,</div>
<div> <font color="#A31515">"listeners"</font>: </div>
<div> {</div>
<div> <font color="#A31515">'checkchange'</font> : <font color="#0000FF">function</font>(node, checked)</div>
<div> {</div>
<div> <font color="#008000">// If a parent node is unchecked, uncheck all the children</font></div>
<div> <font color="#0000FF">if</font> (node.getUI().isChecked()) {</div>
<div> node.expand();</div>
<div> }</div>
<div> <font color="#0000FF">if</font> (!node.getUI().isChecked()) {</div>
<div> node.collapse();</div>
<div> }</div>
<div> },</div>
<div> <font color="#A31515">'load'</font> : <font color="#0000FF">function</font>(e) {</div>
<div> <font color="#0000FF">if</font> (bool_aois == <font color="#0000FF">false</font>)</div>
<div> {</div>
<div> <font color="#008000">//change icon of childNodes to GetLegendGraphic from WMS + node text attribute</font></div>
<div> <font color="#0000FF">var</font> count = (e.childNodes.length -1);</div>
<div> <font color="#0000FF">while</font> (count >= 0)</div>
<div> {</div>
<div> <font color="#0000FF">var</font> label = e.childNodes[count].text; </div>
<div> <font color="#0000FF">var</font> fixed_label = label.replace(/_/g,<font color="#A31515">' '</font>);</div>
<div> e.childNodes[count].setText(<font color="#A31515">"<img src='http://localhost/WebServices/Request.aspx?request=GetLegendGraphic&version=1.1&format=image/png&style=&layer="</font>+label + <font color="#A31515">"'/>"</font> +
<font color="#A31515">' '</font> +fixed_label);</div>
<div> count -=1;</div>
<div> }</div>
<div> bool_aois = <font color="#0000FF">true</font>;</div>
<div> }</div>
<div> <font color="#0000FF">else</font></div>
<div> {</div>
<div> <font color="#008000">//do nothing</font></div>
<div> }</div>
<div> } </div>
<div> },</div>
<div> <font color="#A31515">"loader"</font>: {</div>
<div> <font color="#A31515">"param"</font>: <font color="#A31515">"LAYERS"</font></div>
<div> }</div>
<div> });</div>
<div> </div>
<div> </div>
<div> </div>
<div><font face="Arial, sans-serif"> </font></div>
</font>
<DIV><P><HR>
This e-mail is intended for the original recipient(s) only. If you have received it in error, please advise the sender and delete this message.
</P></DIV>
</body>
</html>