sridhars711 / dynatree

Automatically exported from code.google.com/p/dynatree
0 stars 0 forks source link

Option to control caching of lazy nodes #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
tree.options.cacheLazyNodes = true

Can be set to false, so that collapsing and re-expanding will reload it.

Original issue reported on code.google.com by moo...@wwwendt.de on 30 Aug 2008 at 1:11

GoogleCodeExporter commented 9 years ago
If caching is off, we could *delete* all child <elements> to free up memory 
when a
parent is collapsed.

Original comment by moo...@wwwendt.de on 30 Aug 2008 at 1:25

GoogleCodeExporter commented 9 years ago

Original comment by moo...@wwwendt.de on 30 Aug 2008 at 1:32

GoogleCodeExporter commented 9 years ago

Original comment by moo...@wwwendt.de on 31 Aug 2008 at 9:36

GoogleCodeExporter commented 9 years ago

Original comment by moo...@wwwendt.de on 2 Feb 2009 at 8:18

GoogleCodeExporter commented 9 years ago
Is this enhancement still in effect/under development?
Because I think it'll add to DynaTree.

I've noticed that when you really "walk" the tree: imagine a folder scan, 4 
levels deep, that browsing gets slow after some browsing.
At a certain point, each Lazy subfolder that's clicked, will add a couple of 
ms. overall waiting time to the process.
You can notice this because the loading indicator stays on screen bit longer.

Now.. similar to a "messy desktop": you start closing stuff to clean it up.
Same thing people do with DynaTree: they start closing all the subfolders they 
don't want to see/need at that point, assuming browsing will go faster again, 
because they don't see the all the subfolders. :)

Ofcourse the culprit is the creation of dom nodes, elements etc.

Thus.. YES, if (lazy) subfolder were to be closed, delete them from memory
immediately, or whip up some kind of caching system.
However since JSON retrieves data rather fast, this should not really
be a problem? 

It will probably also cut back in waiting when the whole tree gets .destroyed()
The bigger the tree, the more ms. one has to wait.

Original comment by prana001 on 17 Oct 2010 at 7:24

GoogleCodeExporter commented 9 years ago
I haven't tried, but it should be possible to do achieve this by implementing a 
callback handler:

    onExpand(flag, node)
        if(!flag)
            node.remveChildren()    

Original comment by moo...@wwwendt.de on 17 Oct 2010 at 8:32

GoogleCodeExporter commented 9 years ago
Yes! Works beautifully, thanks!

Original comment by prana001 on 31 Oct 2010 at 11:55

GoogleCodeExporter commented 9 years ago

Original comment by moo...@wwwendt.de on 31 Oct 2010 at 4:20

GoogleCodeExporter commented 9 years ago
considered verified

Original comment by moo...@wwwendt.de on 17 Jul 2012 at 4:12