[Users] Problem With GeoExt.tree.LayerContainer loader
Matt Priour
mpriour at kestrelcomputer.com
Tue Nov 16 20:34:03 CET 2010
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
Sent: Tuesday, November 16, 2010 1:06 PM
To: 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20101116/60c49649/attachment-0001.htm
More information about the Users
mailing list