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.

Matt Priour
Kestrel Computer Consulting

From: Phil Scadden 
Sent: Thursday, July 14, 2011 4:35 PM
Cc: [email protected] 
Subject: Re: [Users] Layertreebuilder has issues when layer removed.



  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.
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?

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.





--------------------------------------------------------------------------------
_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users
_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users

Reply via email to