<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=iso-8859-1>
<META content="MSHTML 6.00.6002.18332" name=GENERATOR><!-- converted from rtf -->
<STYLE><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></STYLE>
</HEAD>
<BODY id=MailContainerBody
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px" leftMargin=0
topMargin=0 CanvasTabStop="true" name="Compose message area">
<DIV><FONT face=Arial size=2>You could add this to the loader at the end of your
configuration:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>...</FONT></DIV>
<DIV><FONT face=Arial size=2><FONT color=#a31515>"loader"</FONT>: {
<DIV> <FONT
color=#a31515>"param"</FONT>: <FONT color=#a31515>"LAYERS",</FONT></DIV>
<DIV><FONT
color=#a31515> baseParams:{</FONT></DIV>
<DIV><FONT
color=#a31515>
listeners:{checkchange:function(node,checked){</FONT></DIV>
<DIV><FONT
color=#a31515>
.... Do Something with checked child node information ....</FONT></DIV>
<DIV><FONT
color=#a31515>
}}</FONT></DIV>
<DIV><FONT
color=#a31515>
}</FONT></DIV>
<DIV> }</DIV>
<DIV> </DIV>
<DIV>'baseParams' are applied to each child node created by the loader.</DIV>
<DIV> </DIV>
<DIV>Matt Priour</DIV>
<DIV>Kestrel Computer Consulting</DIV></FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><FONT face=Arial></FONT><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=Andrew.Stewart@reddeer.ca
href="mailto:Andrew.Stewart@reddeer.ca">Andrew Stewart</A> </DIV>
<DIV><B>Sent:</B> Tuesday, December 28, 2010 11:16 AM</DIV>
<DIV><B>To:</B> <A title=users@geoext.org
href="mailto:users@geoext.org">users@geoext.org</A> </DIV>
<DIV><B>Subject:</B> [Users] Capturing Name of childnode clicked
fromGeoExt.tree.LayerNode</DIV></DIV></DIV>
<DIV><FONT face=Arial size=2></FONT><BR></DIV><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></P></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Users mailing
list<BR>Users@geoext.org<BR>http://www.geoext.org/cgi-bin/mailman/listinfo/users<BR></BODY></HTML>