<!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 color=#0000ff size=2 face=Arial><SPAN
class=564281015-01092010>Thanks a lot, that is exactly what I needed!
:)</SPAN></FONT></DIV><BR>
<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>Ryan
Williams<BR><B>Sent:</B> September 01, 2010 8:59 AM<BR><B>To:</B>
users@geoext.org<BR><B>Subject:</B> Re: [Users] Question on multiple filters for
a LayerContainer control<BR></FONT><BR></DIV>
<DIV></DIV>We had a similar challenge here, one of our web programmers helped me
figure this out.<BR>In this situation, I wanted all layers with a name that did
NOT include "Balance", "Ratio", or "Highlight" to appear in this
layercontainer:<BR><BR>loader: {
<BR>
filter: function(record)
{<BR>
var myarr = new
Array();<BR>
myarr[0]=record.get("layer").name.indexOf("Balance");<BR>
myarr[1]=record.get("layer").name.indexOf("Ratio");<BR>
myarr[2]=record.get("layer").name.indexOf("Highlight");<BR>
<BR>
if(myarr[0]==-1 && myarr[1]==-1 &&
myarr[2]==-1){<BR>
return
true;<BR>
}else{<BR>
return
false;<BR>
}<BR>
}<BR><BR>Not sure if it's THE best solution, but it does work and it's fairly
simple to add additional words to search for. <BR>Hope this helps,
<BR><BR>Ryan<BR><BR>On 9/1/2010 9:49 AM, Andrew Stewart wrote:
<BLOCKQUOTE cite=mid:94816848A8EB3941B1E8592F425827A96845C804A7@chex2.crdnet.ca
type="cite">
<META name=Generator content="Microsoft Exchange Server"><!-- converted from rtf -->
<STYLE>.EmailQuote {
        BORDER-LEFT: #800000 2px solid; PADDING-LEFT: 4pt; MARGIN-LEFT: 1pt
}
</STYLE>
<FONT size=2 face="Arial, sans-serif">
<DIV>I am faily new to GeoExt and openlayers. What I am trying to do is add
multiple filters to a layercontainer so that I can add multiple layers to each
group. Not sure if this is the best way to do this but what I want to do is
add all my Street Labels to a group called "Labels" I can add one no problem
called Overview Streets with the following code, but I need to add additional
layers like one called Quadrant Streets. When I try to modify the filter code
to add additional names it doesn't work and I get javascript errors. Any help
appreciated!</DIV>
<DIV> </DIV>
<DIV><FONT color=#008000 face="Courier New">//Define Layer List Control - Tree
Control for Legend Control</FONT></DIV>
<DIV><FONT face="Courier New"> <FONT
color=#0000ff>var</FONT> layerList_Labels = <FONT color=#0000ff>new</FONT>
GeoExt.tree.LayerContainer({</FONT></DIV>
<DIV><FONT face="Courier New"> text:
<FONT color=#a31515>'Labels'</FONT>,</FONT></DIV>
<DIV><FONT face="Courier New">
layerStore: mapPanel.layers,</FONT></DIV>
<DIV><FONT face="Courier New"> leaf:
<FONT color=#0000ff>false</FONT>,</FONT></DIV>
<DIV><FONT face="Courier New">
expanded: <FONT color=#0000ff>false</FONT>,</FONT></DIV>
<DIV><FONT face="Courier New">
loader: {</FONT></DIV>
<DIV><FONT
face="Courier New">
filter: <FONT color=#0000ff>function</FONT>(record) {</FONT></DIV>
<DIV><FONT
face="Courier New">
<FONT color=#0000ff>return</FONT> record.<FONT color=#0000ff>get</FONT>(<FONT
color=#a31515>"layer"</FONT>).name.indexOf(<FONT color=#a31515>"Overview
Streets"</FONT>) !== -1
(need to add Quadrant Streets here also)</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 color=#000080 face="Courier New"><BR></FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV> </DIV></FONT>
<DIV>
<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. </DIV><PRE wrap=""><FIELDSET class=mimeAttachmentHeader></FIELDSET>
_______________________________________________
Users mailing list
<A class=moz-txt-link-abbreviated href="mailto:Users@geoext.org">Users@geoext.org</A>
<A class=moz-txt-link-freetext href="http://www.geoext.org/cgi-bin/mailman/listinfo/users">http://www.geoext.org/cgi-bin/mailman/listinfo/users</A>
</PRE></BLOCKQUOTE><BR><PRE class=moz-signature cols="72">--
Ryan Williams, GISP
GIS Analyst / Programmer
PAQ Interactive Inc.
107 S State St., Suite 300
Monticello, IL 61856-1968
</PRE>
<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>