<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to support-requests</title><link>https://sourceforge.net/p/webcandy/support-requests/</link><description>Recent changes to support-requests</description><atom:link href="https://sourceforge.net/p/webcandy/support-requests/feed.rss" rel="self"/><language>en</language><lastBuildDate>Wed, 16 Apr 2008 12:27:25 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/webcandy/support-requests/feed.rss" rel="self" type="application/rss+xml"/><item><title>Dynamic tree nodes</title><link>https://sourceforge.net/p/webcandy/support-requests/1/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;In the comments for this.setExpanded() in HTreeNode, you have this example:&lt;/p&gt;
&lt;p&gt;* aboutToExpandOrContract = function( expanding, treeNode )&lt;br /&gt;
* {&lt;br /&gt;
* if ( expanding &amp;amp;&amp;amp; treeNode.children.length == 0 )&lt;br /&gt;
* // children initially defined with zero length array&lt;br /&gt;
*   {&lt;br /&gt;
*   var a = [];&lt;br /&gt;
*   // ... code to fetch children and populate 'a' &lt;br /&gt;
*   treeNode.children = HTree_makeNodes( a );&lt;br /&gt;
*   }&lt;br /&gt;
* }&lt;/p&gt;
&lt;p&gt;I have been unable to get this to work.  Can you give a more complete example, perhaps a modification to htreedemo.js?&lt;/p&gt;
&lt;p&gt;Also, it's implied that this needs to be added to every single data item (if my tree is fully expanded, I have hundreds, and it could go into the thousands), which could be... problematic.  I've made a few changes to the source, introducing a "hasChildren" flag and basing isLeaf() off of that rather than children.length... this lets me set the expand/contract properly without filling in the children first.&lt;/p&gt;
&lt;p&gt;I've also created an HFolderTree (with matching HFolderTreeNode, etc.) to have a "directory browser", where a "leaf" is a folder with no sub-folders.  This lets me always show folder icons, as most would expect.&lt;/p&gt;
&lt;p&gt;Any tips would be appreciated.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">JamieC</dc:creator><pubDate>Wed, 16 Apr 2008 12:27:25 -0000</pubDate><guid>https://sourceforge.net274d5fd175b9a55aa0718b08347d15c6ebd90d0b</guid></item></channel></rss>