[Users] Problem With GeoExt.tree.LayerContainer loader
Andrew Stewart
Andrew.Stewart at reddeer.ca
Tue Nov 16 20:45:38 CET 2010
Thanks Matt, that's what I ended up with but your example provides an even easier code sample for me to follow.
________________________________
From: Matt Priour [mailto:mpriour at kestrelcomputer.com]
Sent: November 16, 2010 12:34 PM
To: Andrew Stewart; users at geoext.org
Subject: Re: [Users] Problem With GeoExt.tree.LayerContainer loader
Sure, you can either make the filter function test more specific
ex: filter:function(record){return record.get('layer').name=="Monday"}
or if you really just want a single layer then, you should use a 'gx_layer' nodeType for a GeoExt.tree.LayerNode
ex: {text:'Monday',
nodeType:'gx_layer',
checked:true,
layer:'Monday'}
layer needs to refer to either the layer name that you used when you created the OpenLayers.Layer instance or an actual layer object.
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.
Matt Priour
Kestrel Computer Consulting
From: Andrew Stewart<mailto:Andrew.Stewart at reddeer.ca>
Sent: Tuesday, November 16, 2010 1:06 PM
To: users at geoext.org<mailto:users at geoext.org>
Subject: [Users] Problem With GeoExt.tree.LayerContainer loader
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.
loader:
{
filter: function(record)
{
var myarr = new Array();
myarr[0] = record.get("layer").name.indexOf("Monday");
if(myarr[0]==-1)
{
return false;
}
else
{
return true;
}
}
}
});
________________________________
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.
________________________________
_______________________________________________
Users mailing list
Users at geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users
________________________________
[This message has been scanned for security content threats and viruses.]
[The City of Red Deer I.T. Services asks that you please consider the environment before printing this e-mail.]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20101116/c1d5b1de/attachment.htm
More information about the Users
mailing list