<HTML><HEAD>
<META content="text/html; charset=UTF-8" http-equiv=Content-Type></HEAD>
<BODY dir=ltr bgColor=#ffffff text=#000000>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Arial'; COLOR: #000000; FONT-SIZE: 10pt">
<DIV>Well technically, since the layer is removed via user interaction with the
tree, then I find the layer associated with the node, remove it, and then remove
the node and remove empty parents. In my project this is all custom code and not
part of GeoExt. However, if your using the layertreebuilder user extension and
it is removing the layer and node for you and you want to run the remove empty
parents logic, then you can run that on the treepanel’s ‘remove’ event.</DIV>
<DIV> </DIV>
<DIV style="FONT-FAMILY: 'Arial'; COLOR: #000000; FONT-SIZE: 10pt">Matt
Priour<BR>Kestrel Computer Consulting</DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV style="FONT: 10pt tahoma">
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=p.scadden@gns.cri.nz
href="mailto:p.scadden@gns.cri.nz">Phil Scadden</A> </DIV>
<DIV><B>Sent:</B> Thursday, July 14, 2011 4:35 PM</DIV>
<DIV><B>Cc:</B> <A title=users@geoext.org
href="mailto:users@geoext.org">users@geoext.org</A> </DIV>
<DIV><B>Subject:</B> Re: [Users] Layertreebuilder has issues when layer
removed.</DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none"><BR>
<BLOCKQUOTE cite=mid:A5B91344C3484A1D847FEAA7998626F4@Lenovo type="cite">
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Arial'; COLOR: #000000; FONT-SIZE: 10pt">
<DIV>You’re right. I wasn’t paying much attention to the actual removal logic
there. I was mostly trying to demonstrate the use of cascade and/or eachChild.
I used something like that in a project were there were all leaf nodes were
always part of a group node.</DIV></DIV></DIV></BLOCKQUOTE>Just to clarify here.
This is in your main code, not in added to Geoext somewhere. So when you remove
a layer in your main code (I go mapPanel.map.layers[i].destroy() to remove), you
are locating the associated node in the layertree and then executing your
code?<BR>
<P><SPAN style="FONT-FAMILY: 'Arial'; COLOR: #000000; FONT-SIZE: 8pt">Notice:
This email and any attachments are confidential. If received in error please
destroy and immediately notify us. Do not copy or disclose the
contents.</SPAN></P>
<P><SPAN
style="FONT-FAMILY: 'Arial'; COLOR: #000000; FONT-SIZE: 8pt"></SPAN> </P>
<P>
<HR>
_______________________________________________<BR>Users mailing
list<BR>Users@geoext.org<BR>http://www.geoext.org/cgi-bin/mailman/listinfo/users<BR></DIV></DIV></DIV></BODY></HTML>