<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18975"><!-- converted from rtf -->
<STYLE>.EmailQuote {
        BORDER-LEFT: #800000 2px solid; PADDING-LEFT: 4pt; MARGIN-LEFT: 1pt
}
</STYLE>
</HEAD>
<BODY>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=262232123-22112010>So I
have tried to change the icon of each childNode after the expand event like so
-</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=262232123-22112010></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=262232123-22112010><FONT
color=#a31515 size=2><FONT color=#a31515 size=2>
<P>'expand'</FONT></FONT><FONT color=#000000 size=2> : {fn: </FONT><FONT
color=#0000ff size=2><FONT color=#0000ff size=2>function</FONT></FONT><FONT
size=2><FONT color=#000000>(node) {<BR></FONT></FONT><FONT color=#0000ff
size=2><FONT color=#0000ff size=2>var</FONT></FONT><FONT size=2> count =
(node.childNodes.length -1);<BR></FONT><FONT color=#0000ff size=2><FONT
color=#0000ff size=2>while</FONT></FONT><FONT size=2> (count >=
0)<BR>{node.childNodes[count].setIcon(</FONT><FONT color=#a31515 size=2><FONT
color=#a31515 size=2>"../images/minus.png"</FONT></FONT><FONT size=2>);<BR>count
-=1;<BR>}<BR>}}</P></FONT></SPAN></FONT></DIV>
<DIV><SPAN class=262232123-22112010></SPAN><FONT face=Arial><FONT
color=#0000ff><FONT
size=2>But this does not seem to work, anything else I can try?</FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT
size=2></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=262232123-22112010></SPAN></FONT></FONT></FONT> </DIV>
<DIV><BR></DIV>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> users-bounces@geoext.org
[mailto:users-bounces@geoext.org] <B>On Behalf Of </B>Andrew
Stewart<BR><B>Sent:</B> November 22, 2010 3:51 PM<BR><B>To:</B>
users@geoext.org<BR><B>Subject:</B> [Users] Question on using WMS
GetLegendGraphic with a GeoExt.tree.LayerNode<BR></FONT><BR></DIV>
<DIV></DIV><FONT size=2 face="Arial, sans-serif">
<DIV>Is it possible to show a legend graphic which is returned from my WMS
GetLegendGraphic request next to each item on the LayerNode after it is
expanded? (or before.. Or whenever as long as it shows).</DIV>
<DIV> </DIV>
<DIV>I declare my layernode like so -</DIV>
<DIV> </DIV>
<DIV><FONT color=#008000 face="Courier New">//Trails layerList</FONT></DIV>
<DIV><FONT face="Courier New">
layerList_Trails = <FONT color=#0000ff>new</FONT>
GeoExt.tree.LayerNode({</FONT></DIV>
<DIV><FONT face="Courier New"> <FONT
color=#a31515>"layer"</FONT>: layer_Trails,</FONT></DIV>
<DIV><FONT face="Courier New"> <FONT
color=#a31515>"isLeaf"</FONT>: <FONT color=#0000ff>false</FONT>,</FONT></DIV>
<DIV><FONT face="Courier New"> <FONT
color=#a31515>"checked"</FONT>: <FONT color=#0000ff>false</FONT>,</FONT></DIV>
<DIV><FONT face="Courier New"> <FONT
color=#a31515>"enableDD"</FONT>: <FONT color=#0000ff>true</FONT>,</FONT></DIV>
<DIV><FONT face="Courier New"> <FONT
color=#a31515>"cls"</FONT>: <FONT color=#a31515>"rootnode"</FONT>,</FONT></DIV>
<DIV><FONT face="Courier New"> <FONT
color=#a31515>"singleClickExpand"</FONT>: <FONT
color=#0000ff>true</FONT>,</FONT></DIV>
<DIV><FONT face="Courier New"> <FONT
color=#a31515>"listeners"</FONT>: {</FONT></DIV>
<DIV><FONT face="Courier New"> <FONT
color=#a31515>'checkchange'</FONT> : <FONT
color=#0000ff>function</FONT>(node, checked)</FONT></DIV>
<DIV><FONT
face="Courier New">
{</FONT></DIV>
<DIV><FONT
face="Courier New">
<FONT color=#008000>// If a parent node is unchecked, uncheck all the
children</FONT></FONT></DIV>
<DIV><FONT
face="Courier New">
<FONT color=#0000ff>if</FONT> (node.getUI().isChecked()) {</FONT></DIV>
<DIV><FONT
face="Courier New">
node.expand();</FONT></DIV>
<DIV><FONT
face="Courier New">
}</FONT></DIV>
<DIV><FONT
face="Courier New">
<FONT color=#0000ff>if</FONT> (!node.getUI().isChecked())</FONT></DIV>
<DIV><FONT
face="Courier New">
{</FONT></DIV>
<DIV><FONT
face="Courier New">
node.collapse();</FONT></DIV>
<DIV><FONT
face="Courier New">
}</FONT></DIV>
<DIV><FONT face="Courier New"> }</FONT></DIV>
<DIV><FONT face="Courier New"> },</FONT></DIV>
<DIV><FONT face="Courier New"> <FONT
color=#a31515>"loader"</FONT>: {</FONT></DIV>
<DIV><FONT
face="Courier New">
<FONT color=#a31515>"param"</FONT>: <FONT
color=#a31515>"LAYERS"</FONT></FONT></DIV>
<DIV><FONT face="Courier New">
}</FONT></DIV>
<DIV><FONT face="Courier New">
});</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">Which is added to my root -</FONT></DIV>
<DIV><FONT
face="Courier New">layerRoot_Legend.appendChild(layerList_Trails);</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">And then my treepanel</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV>var layerRoot_Legend = new Ext.tree.TreeNode({</DIV>
<DIV> enableDD: true,</DIV>
<DIV> text: "All Legend Items",</DIV>
<DIV> loaded: true,</DIV>
<DIV> expanded: true</DIV>
<DIV> });</DIV>
<DIV> </DIV>
<DIV> var layerTree_Legend = new
Ext.tree.TreePanel({</DIV>
<DIV> title: '',</DIV>
<DIV> root: layerRoot_Legend,</DIV>
<DIV> enableDD: true,</DIV>
<DIV> applyLoader: true,</DIV>
<DIV> rootVisible: false</DIV>
<DIV> });</DIV>
<DIV> </DIV>
<DIV><FONT color=#000080></FONT> </DIV>
<DIV style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><FONT color=#000080
face="Verdana, sans-serif">Except previously when I declared my layers
individually I had put an <img> tag with the right layer next to each..
But now I am declaring them in groups like -</FONT></DIV>
<DIV style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><FONT size=3
face="Times New Roman, serif">
//Trails Group<BR> var
layer_Trails = new OpenLayers.Layer.WMS("<img
src='http://localhost/WebService/Request.aspx?request=GetLegendGraphic&version=1.1.1&format=image/png&layer=Asphalt'
alt=''/>Trails", "<A href="http://localhost/WebService/Request.aspx"><FONT
color=#0000ff><U>http://localhost/WebService/Request.aspx</U></FONT></A>",</FONT></DIV>
<DIV style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><FONT size=3
face="Times New Roman, serif">
{<BR> layers:
['Onstreet_Bike_Route', 'Mountain_-_Stunt_Biking', 'Equestrian',
'Gravel_or_Shale', 'Asphalt'],</FONT></DIV>
<DIV style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><FONT size=3
face="Times New Roman, serif">
VERSION:
"1.1.1",<BR>
transparent:
true<BR>
},<BR>
{ isBaseLayer:
false,<BR>
singleTile:
true,<BR>
visibility:
false,<BR>
buffer:
1,<BR>
ratio:
1<BR>
}</FONT></DIV>
<DIV style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><FONT size=3
face="Times New Roman, serif">But this only puts the image on the actual group
name and I need it to be beside each legend entry when it is expanded. Is there
a place somewhere I can stick this image tag and either hard code the layer name
or have it be returned from the childNodes of the tree and get it to show this
image beside each childNode? Appreciate any assistance!</FONT></DIV>
<DIV><FONT size=3 face="Times New Roman, serif"></FONT> </DIV>
<DIV> </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>
<DIV>
<P>
<HR>
[This message has been scanned for security content threats and
viruses.]<BR><BR>[The City of Red Deer I.T. Services asks that you please
consider the environment before printing this e-mail.]<BR>
<P></P></DIV>
<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>