<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=utf-8>
<META content="MSHTML 6.00.6001.18294" name=GENERATOR></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>I was actually suggesting attaching a listener to
the render event (ie fires after render). Then directly uncheck the correct node
programattically.</FONT></DIV>
<DIV><FONT face=Arial size=2>Matt Priour</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=pauljame@gmail.com
href="mailto:pauljame@gmail.com">Paul james</A> </DIV>
<DIV><B>Sent:</B> Thursday, October 15, 2009 8:38 AM</DIV>
<DIV><B>To:</B> <A title=ahocevar@opengeo.org
href="mailto:ahocevar@opengeo.org">Andreas Hocevar</A> </DIV>
<DIV><B>Cc:</B> <A title=mpriour@kestrelcomputer.com
href="mailto:mpriour@kestrelcomputer.com">Matt Priour</A> ; <A
title=bartvde@osgis.nl href="mailto:bartvde@osgis.nl">bartvde@osgis.nl</A> ; <A
title=users@geoext.org href="mailto:users@geoext.org">users@geoext.org</A>
</DIV>
<DIV><B>Subject:</B> Re: [Users] Set visibility on Sub-layers</DIV></DIV></DIV>
<DIV><BR></DIV>
<DIV>Ohh no :(</DIV>
<DIV>Any other alternative to solve that?</DIV>
<DIV> </DIV>
<DIV>ps.: Can you send that ticket url?</DIV>
<DIV> </DIV>
<DIV>Paul<BR><BR></DIV>
<DIV class=gmail_quote>On Wed, Oct 14, 2009 at 11:12 PM, Andreas Hocevar <SPAN
dir=ltr><<A
href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<DIV class=im>Andreas Hocevar wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi
Paul,<BR><BR>the recommendations given so far should all work, but let Papa
Treenode speak from his experience:<BR><BR>The best thing to do is override
the createNode function of the loader, as documented in <A
href="http://www.extjs.com/deploy/dev/docs/?class=Ext.tree.TreeLoader"
target=_blank>http://www.extjs.com/deploy/dev/docs/?class=Ext.tree.TreeLoader</A>.<BR></BLOCKQUOTE><BR></DIV>which,
unfortunately, will *not* work because GeoExt sets the visibility in the
node's render method, regardless of its checked attribute. A tickdt with patch
that fixes this would be in order I guess.<BR><BR>Regards,<BR><FONT
color=#888888>Andreas.</FONT>
<DIV>
<DIV></DIV>
<DIV class=h5><BR><BR><BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><BR>The
createNode function is called with the attributes (attrs) as argument, so
you could check for attr.text and then set attr.checked
accordingly.<BR><BR>Regards,<BR>Andreas.<BR><BR>Paul james wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Thanks
Matt...<BR>I tried that:<BR> nodeType: "gx_layer",<BR>
id: "Streets",<BR>
layer: "Streets",<BR>
isLeaf: false,<BR>
expanded : true,
loader: {<BR>
param: "LAYERS",
baseAttrs: {<BR>
uiProvider:
Ext.extend(Ext.tree.TreeNodeUI, {<BR>
render: function(bulkRender) {
if(this.node.text == "Layer3")
this.node.layer.setVisibility(false);
Ext.tree.TreeNodeUI.prototype.render.apply(this, arguments);
}<BR>...<BR> But all
node´s layer are set off... How can I set the subnode´s visibility
separately?<BR> Thanks<BR> Paul<BR><BR>On Wed, Oct 14, 2009 at
11:50 AM, Matt Priour <<A href="mailto:mpriour@kestrelcomputer.com"
target=_blank>mpriour@kestrelcomputer.com</A> <mailto:<A
href="mailto:mpriour@kestrelcomputer.com"
target=_blank>mpriour@kestrelcomputer.com</A>>> wrote:<BR><BR>
Handle the 'render' event of the layer tree and
programmatically<BR> uncheck the nodes that you don't want
on.<BR> The only disadvantage of this method is that depending
on timing the<BR> application may or may not attempt to do
GetMap requests on the<BR> layers you don't want. Though they
still would not be visible, if<BR> you are calling a slow
service or complex rendering is involved,<BR> then the GetMap
requests can block other WMS service requests.<BR> Matt
Priour<BR> Kestrel Computer Consullting<BR>
*From:* Paul james <mailto:<A href="mailto:pauljame@gmail.com"
target=_blank>pauljame@gmail.com</A>><BR> *Sent:*
Wednesday, October 14, 2009 9:39 AM<BR> *To:* <A
href="mailto:bartvde@osgis.nl" target=_blank>bartvde@osgis.nl</A>
<mailto:<A href="mailto:bartvde@osgis.nl"
target=_blank>bartvde@osgis.nl</A>><BR> *Cc:* <A
href="mailto:users@geoext.org" target=_blank>users@geoext.org</A>
<mailto:<A href="mailto:users@geoext.org"
target=_blank>users@geoext.org</A>> ; Andreas Hocevar<BR>
<mailto:<A href="mailto:ahocevar@opengeo.org"
target=_blank>ahocevar@opengeo.org</A>><BR> *Subject:* Re:
[Users] Set visibility on Sub-layers<BR><BR> Thanks
bart...<BR> But I need set all layers to build up my treeview,
like that:<BR> nodeType: "gx_layer",<BR>
layer: "Streets",<BR>
isLeaf: false,<BR>
loader: {<BR>
param: "LAYERS",<BR> ...<BR>
<BR> On Wed, Oct 14, 2009 at 11:16 AM,
<<A href="mailto:bartvde@osgis.nl"
target=_blank>bartvde@osgis.nl</A><BR> <mailto:<A
href="mailto:bartvde@osgis.nl" target=_blank>bartvde@osgis.nl</A>>>
wrote:<BR><BR> Hi Paul,<BR><BR>
only by using LAYERS: ['layer1', 'layer2'].<BR><BR>
Then later on, when you need more layers, you should
change the<BR> LAYERS<BR>
param using the mergeNewParams function.<BR><BR>
Best regards,<BR> Bart<BR><BR>
> Hello guys... I have that set of sublayers
:<BR> ><BR> >
new OpenLayers.Layer.MapServer("Streets",<BR>
> _cgi,
{<BR> >
map: _mapfile,<BR>
>
"LAYERS":<BR>
['Layer1','Layer2','Layer3','Layer4',<BR>
> 'Layer5'],<BR> >
transparent:
true,<BR> >
format: "image/png"<BR>
>
}, {<BR> >
isBaseLayer:
false,<BR> >
buffer: 0,<BR>
>
displayInLayerSwitcher: false,<BR>
>
visibility: false<BR> >
})<BR>
><BR> > I悲 like to start with
Layer1 and Layer2 with visibility true<BR> ...
How can<BR> > I<BR>
> do that?<BR> ><BR>
> Paul<BR> >
_______________________________________________<BR>
> Users mailing list<BR> > <A
href="mailto:Users@geoext.org" target=_blank>Users@geoext.org</A>
<mailto:<A href="mailto:Users@geoext.org"
target=_blank>Users@geoext.org</A>><BR> >
<A href="http://www.geoext.org/cgi-bin/mailman/listinfo/users"
target=_blank>http://www.geoext.org/cgi-bin/mailman/listinfo/users</A><BR>
><BR><BR><BR><BR>
------------------------------------------------------------------------<BR><BR>
_______________________________________________<BR>
Users mailing list<BR> <A href="mailto:Users@geoext.org"
target=_blank>Users@geoext.org</A> <mailto:<A
href="mailto:Users@geoext.org"
target=_blank>Users@geoext.org</A>><BR> <A
href="http://www.geoext.org/cgi-bin/mailman/listinfo/users"
target=_blank>http://www.geoext.org/cgi-bin/mailman/listinfo/users</A><BR><BR><BR></BLOCKQUOTE><BR><BR></BLOCKQUOTE><BR><BR>--
<BR>Andreas Hocevar<BR>OpenGeo - <A href="http://opengeo.org/"
target=_blank>http://opengeo.org/</A><BR>Expert service straight from the
developers.<BR></DIV></DIV></BLOCKQUOTE></DIV><BR></BODY></HTML>