<!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.18309" 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>Sure, you can either make the filter function test
more specific</FONT></DIV>
<DIV><FONT face=Arial size=2>ex: filter:function(record){return
record.get('layer').name=="Monday"}</FONT></DIV>
<DIV><FONT face=Arial size=2>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 face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>ex: {text:'Monday',</FONT></DIV>
<DIV><FONT face=Arial size=2> nodeType:'gx_layer',</FONT></DIV>
<DIV><FONT face=Arial size=2> checked:true,</FONT></DIV>
<DIV><FONT face=Arial size=2> layer:'Monday'}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>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 face=Arial size=2>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 face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Matt Priour</FONT></DIV>
<DIV><FONT face=Arial size=2>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 face="Arial, sans-serif" size=2>
<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></BODY></HTML>