[Users] Layertreebuilder has issues when layer removed.

Phil Scadden p.scadden at gns.cri.nz
Thu Jul 14 04:56:21 CEST 2011


You should change your function to this:
> tree.getRootNode().cascade(function(node){
>    if (!node.childNodes || node.childNodes.length==0) {
>       node.remove();
>    }
> }
>
That would surely remove the leaf nodes as well as empty group nodes? 
The trick is recognize that the node is a group node rather than a layer 
leaf node.

I never thought of a delay. on remove. Will experiment.
-- 
Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St, 
Private Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232

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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110714/4daee99b/attachment.htm 


More information about the Users mailing list