<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
You should change your function to this:
<blockquote cite="mid:C95FA3DF461F4110954B142E9199987E@Lenovo"
type="cite">
<div dir="ltr">
<div style="FONT-FAMILY: 'Arial'; COLOR: #000000; FONT-SIZE:
10pt">
<div> </div>
<div><font face="Calibri"><font style="FONT-SIZE: 12pt">tree.getRootNode().cascade(function(node){<br>
if (!node.childNodes || node.childNodes.length==0) {<br>
node.remove();<br>
}</font></font></div>
<div><font face="Calibri"><font style="FONT-SIZE: 12pt">}</font></font><br>
</div>
<br>
</div>
</div>
</blockquote>
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.<br>
<br>
I never thought of a delay. on remove. Will experiment.<br>
<div class="moz-signature">-- <br>
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</div>
<p><span style="font-family:'Arial';font-size:8pt; color:#000000;">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';font-size:8pt; color:#000000;"> </span></p></body>
</html>