<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Arial, sans-serif" size="2">
<div><font color="#0000FF">Ok figured it out, just had to modify the code to the following - </font></div>
<div><font color="#0000FF"> </font></div>
<div><font face="Courier New"> <font color="#0000FF">if</font> (record.data.title == <font color="#A31515">'Monday'</font>)</font></div>
<div><font face="Courier New"> <font color="#0000FF">return</font> <font color="#0000FF">true</font>;</font></div>
<div><font face="Courier New" color="#000080"><br>
</font></div>
<div><font face="Courier New"> </font></div>
<div>And it only returns the layer marked Monday now.</div>
<div><font face="Tahoma, sans-serif" size="1">_____________________________________________ </font></div>
<div style="padding-left: 72pt; text-indent: -72pt; "><font face="Tahoma, sans-serif" size="1"><b>From: </b>Andrew Stewart </font></div>
<div style="padding-left: 72pt; text-indent: -72pt; "><font face="Tahoma, sans-serif" size="1"><b>Sent: </b>November 16, 2010 12:07 PM</font></div>
<div style="padding-left: 72pt; text-indent: -72pt; "><font face="Tahoma, sans-serif" size="1"><b>To: </b>users@geoext.org</font></div>
<div style="padding-left: 72pt; text-indent: -72pt; "><font face="Tahoma, sans-serif" size="1"><b>Subject: </b>Problem With GeoExt.tree.LayerContainer loader</font></div>
<div style="padding-left: 72pt; text-indent: -72pt; "><font face="Tahoma, sans-serif" size="1"> </font></div>
<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 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></DIV>
</body>
</html>