<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18939"></HEAD>
<BODY bgColor=#ffffff text=#000000>
<DIV dir=ltr align=left><FONT size=2 face=Arial><SPAN
class=102160316-01092010>Trying to find a good example on how to add multiple
LayerContainers to my TreePanel but so far unsuccesful.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT> </DIV>
<DIV><SPAN class=102160316-01092010><FONT size=2 face=Arial>I've defined two
LayerContainer controls like so -</FONT></SPAN></DIV><!-- Converted from text/rtf format --><FONT color=#008000
size=2><FONT color=#008000 size=2>
<P><BR></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff
size=2>var</FONT></FONT><FONT size=2> layerList_Labels = </FONT><FONT
color=#0000ff size=2><FONT color=#0000ff size=2>new</FONT></FONT><FONT size=2>
GeoExt.tree.LayerContainer({<BR>text: </FONT><FONT color=#a31515 size=2><FONT
color=#a31515 size=2>'Labels'</FONT></FONT><FONT size=2>,<BR>layerStore:
mapPanel.layers,<BR>leaf: </FONT><FONT color=#0000ff size=2><FONT color=#0000ff
size=2>false</FONT></FONT><FONT size=2>,<BR>expanded: </FONT><FONT color=#0000ff
size=2><FONT color=#0000ff size=2>false</FONT></FONT><FONT size=2>,<BR>loader:
<BR>{<BR>filter: </FONT><FONT color=#0000ff size=2><FONT color=#0000ff
size=2>function</FONT></FONT><FONT size=2>(record) <BR>{<BR></FONT><FONT
color=#0000ff size=2><FONT color=#0000ff size=2>var</FONT></FONT><FONT size=2>
myarr = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff
size=2>new</FONT></FONT><FONT size=2> Array();<BR>myarr[0] = record.</FONT><FONT
color=#0000ff size=2><FONT color=#0000ff size=2>get</FONT></FONT><FONT
size=2>(</FONT><FONT color=#a31515 size=2><FONT color=#a31515
size=2>"layer"</FONT></FONT><FONT size=2>).name.indexOf(</FONT><FONT
color=#a31515 size=2><FONT color=#a31515 size=2>"Overview
Streets"</FONT></FONT><FONT size=2>);<BR>myarr[1] = record.</FONT><FONT
color=#0000ff size=2><FONT color=#0000ff size=2>get</FONT></FONT><FONT
size=2>(</FONT><FONT color=#a31515 size=2><FONT color=#a31515
size=2>"layer"</FONT></FONT><FONT size=2>).name.indexOf(</FONT><FONT
color=#a31515 size=2><FONT color=#a31515 size=2>"Quadrant
Streets"</FONT></FONT><FONT size=2>);<BR></FONT><FONT color=#0000ff size=2><FONT
color=#0000ff size=2>if</FONT></FONT><FONT size=2>(myarr[0]==-1 &&
myarr[1]==-1)<BR>{<BR></FONT><FONT size=2><FONT color=#0000ff><SPAN
class=102160316-01092010>r</SPAN>eturn</FONT> <FONT color=#0000ff><FONT
color=#0000ff>false</FONT></FONT>;<BR></FONT><FONT size=2>}<BR></FONT><FONT
color=#0000ff><FONT color=#0000ff><FONT
size=2>else<BR></FONT></FONT></FONT><FONT size=2>{<BR></FONT><FONT size=2><FONT
color=#0000ff><FONT color=#0000ff>return</FONT></FONT> <FONT color=#0000ff><FONT
color=#0000ff>true</FONT></FONT>;<BR></FONT><FONT size=2>}<BR></FONT><FONT
size=2>}<BR></FONT><FONT size=2>}<BR></FONT><FONT size=2>});</FONT></P>
<P><FONT size=2></FONT><BR><FONT size=2><FONT color=#0000ff><FONT
color=#0000ff>var</FONT></FONT> layerList_Labels<SPAN
class=102160316-01092010>2</SPAN> = <FONT color=#0000ff><FONT
color=#0000ff>new</FONT></FONT> GeoExt.tree.LayerContainer({<BR>text: <FONT
color=#a31515>'Labels<SPAN
class=102160316-01092010>2</SPAN>'</FONT>,<BR>layerStore:
mapPanel.layers,<BR>leaf: <FONT color=#0000ff><FONT
color=#0000ff>false</FONT></FONT>,<BR>expanded: <FONT color=#0000ff><FONT
color=#0000ff>false</FONT></FONT>,<BR>loader: <BR>{<BR>filter: <FONT
color=#0000ff><FONT color=#0000ff>function</FONT></FONT>(record) <BR>{<BR><FONT
color=#0000ff><FONT color=#0000ff>var</FONT></FONT> myarr = <FONT
color=#0000ff><FONT color=#0000ff>new</FONT></FONT> Array();<BR>myarr[0] =
record.<FONT color=#0000ff><FONT color=#0000ff>get</FONT></FONT>(<FONT
color=#a31515><FONT color=#a31515>"layer"</FONT></FONT>).name.indexOf(<FONT
color=#a31515><FONT color=#a31515>"Overview Streets"</FONT></FONT>);<BR>myarr[1]
= record.<FONT color=#0000ff><FONT color=#0000ff>get</FONT></FONT>(<FONT
color=#a31515><FONT color=#a31515>"layer"</FONT></FONT>).name.indexOf(<FONT
color=#a31515><FONT color=#a31515>"Quadrant Streets"</FONT></FONT>);<BR><FONT
color=#0000ff><FONT color=#0000ff>if</FONT></FONT>(myarr[0]==-1 &&
myarr[1]==-1)<BR>{<BR><FONT color=#0000ff><SPAN
class=102160316-01092010>r</SPAN>eturn</FONT> <FONT color=#0000ff><FONT
color=#0000ff>false</FONT></FONT>;<BR>}<BR></FONT><FONT color=#0000ff><FONT
color=#0000ff><FONT size=2>else<BR></FONT></FONT></FONT><FONT
size=2>{<BR></FONT><FONT size=2><FONT color=#0000ff><FONT
color=#0000ff>return</FONT></FONT> <FONT color=#0000ff><FONT
color=#0000ff>true</FONT></FONT>;<BR></FONT><FONT size=2>}<BR></FONT><FONT
size=2>}<BR></FONT><FONT size=2>}<BR></FONT><FONT size=2>});</FONT></P>
<P><SPAN class=102160316-01092010><FONT color=#0000ff face=Arial>Now I am just
unsure exactly how to add these both to my TreePanel - i've tried adding them
both to root, or trying to use children but it is not showing up. Any help
greatly appreciated.</FONT></SPAN></P><SPAN class=102160316-01092010><FONT
size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff
size=2>var</FONT></FONT><FONT size=2> layerTree = </FONT><FONT color=#0000ff
size=2><FONT color=#0000ff size=2>new</FONT></FONT><FONT size=2>
Ext.tree.TreePanel({<BR>title: </FONT><FONT color=#a31515 size=2><FONT
color=#a31515 size=2>''</FONT></FONT><FONT size=2>,<BR>renderTo: </FONT><FONT
color=#a31515 size=2><FONT color=#a31515 size=2>'legend'</FONT></FONT><FONT
size=2>,<BR>root: layerList_Labels,<BR>enableDD: </FONT><FONT color=#0000ff
size=2><FONT color=#0000ff size=2>true</FONT></FONT><FONT
size=2>,<BR>applyLoader: </FONT><FONT color=#0000ff size=2><FONT color=#0000ff
size=2>true<BR></FONT></FONT><FONT size=2>});</P></FONT></SPAN>
<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>