<!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 style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody leftMargin=0 topMargin=0 name="Compose message area"
CanvasTabStop="true">
<DIV dir=ltr align=left><SPAN class=224564419-16112010><FONT color=#0000ff
size=2 face=Arial>Thanks Matt, that's what I ended up with but your example
provides an even easier code sample for me to follow.</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> Matt Priour
[mailto:mpriour@kestrelcomputer.com] <BR><B>Sent:</B> November 16, 2010 12:34
PM<BR><B>To:</B> Andrew Stewart; users@geoext.org<BR><B>Subject:</B> Re: [Users]
Problem With GeoExt.tree.LayerContainer loader<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT size=2 face=Arial>Sure, you can either make the filter function test
more specific</FONT></DIV>
<DIV><FONT size=2 face=Arial>ex: filter:function(record){return
record.get('layer').name=="Monday"}</FONT></DIV>
<DIV><FONT size=2 face=Arial>or if you really just want a single layer then, you
should use a 'gx_layer' nodeType for a GeoExt.tree.LayerNode</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>ex: {text:'Monday',</FONT></DIV>
<DIV><FONT size=2 face=Arial> nodeType:'gx_layer',</FONT></DIV>
<DIV><FONT size=2 face=Arial> checked:true,</FONT></DIV>
<DIV><FONT size=2 face=Arial> layer:'Monday'}</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>layer needs to refer to either the layer name that
you used when you created the OpenLayers.Layer instance or an actual layer
object.</FONT></DIV>
<DIV><FONT size=2 face=Arial>If you use a name for the layer attribute, & do
not include a layerStore attribute, then the layer store will be infered from
the MapPanel's layer store.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Matt Priour</FONT></DIV>
<DIV><FONT size=2 face=Arial>Kestrel Computer Consulting</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><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, November 16, 2010 1:06 PM</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] Problem With GeoExt.tree.LayerContainer
loader</DIV></DIV></DIV>
<DIV><BR></DIV><FONT size=2 face="Arial, sans-serif">
<DIV>I am having a slight issue. What happens if you have 2 layers with similar
names like one called Monday and the other called Monday Too. With my loader
code below both layers would show up in my layertree evne though I only want the
first one (Monday) to show, can it be modified so that it will match exact names
of layers only? Appreciate any advice.</DIV>
<DIV> </DIV>
<DIV><FONT face="Courier New">loader: </FONT></DIV>
<DIV><FONT face="Courier New">
{</FONT></DIV>
<DIV><FONT
face="Courier New">
filter: <FONT color=#0000ff>function</FONT>(record) </FONT></DIV>
<DIV><FONT
face="Courier New">
{</FONT></DIV>
<DIV><FONT
face="Courier New">
<FONT color=#0000ff>var</FONT> myarr = <FONT color=#0000ff>new</FONT>
Array();</FONT></DIV>
<DIV><FONT
face="Courier New">
myarr[0] = record.<FONT color=#0000ff>get</FONT>(<FONT
color=#a31515>"layer"</FONT>).name.indexOf(<FONT
color=#a31515>"Monday"</FONT>);</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT
face="Courier New">
<FONT color=#0000ff>if</FONT>(myarr[0]==-1)</FONT></DIV>
<DIV><FONT
face="Courier New">
{</FONT></DIV>
<DIV><FONT
face="Courier New">
<FONT color=#0000ff>return</FONT> <FONT color=#0000ff>false</FONT>;</FONT></DIV>
<DIV><FONT
face="Courier New">
}</FONT></DIV>
<DIV><FONT
face="Courier New">
<FONT color=#0000ff>else</FONT></FONT></DIV>
<DIV><FONT
face="Courier New">
{</FONT></DIV>
<DIV><FONT
face="Courier New">
<FONT color=#0000ff>return</FONT> <FONT color=#0000ff>true</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">
});</FONT></DIV>
<DIV><FONT face="Courier New"></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>
<P>
<HR>
<P></P>_______________________________________________<BR>Users mailing
list<BR>Users@geoext.org<BR>http://www.geoext.org/cgi-bin/mailman/listinfo/users<BR>
<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>