Dynatree slow when dynamically loaded with 100+ nodes

末鹿安然 提交于 2019-12-14 02:30:33

问题


How do I speed it up?

I get the results from JSON web service (lightning fast). Adding nodes to the tree using

something like

parentNode.addChild({
        key: key,
        title: value,
        addClass: cssClass
    });

Unfortunately, a tree with 100+ elements takes 1.5 minutes to load. I am disappointed...is it not made to be used with that many nodes? Anything I can do at this point aside from switching to another component?

Thanks!


回答1:


This benchmark shows that it is loads pretty fast: http://wwwendt.de/tech/dynatree/doc/test-bench.html (Theres always room for improvement though...)

Your problem might be, that you load and add the nodes seperately? In this case the tree is also rendered 100+ times, and that is slow indeed.

Have a look at the sample, to see how load a batch of nodes with one call: http://wwwendt.de/tech/dynatree/doc/sample-lazy.html




回答2:


Looks like there is an example of lazy loading the tree. Might try that out: http://wwwendt.de/tech/dynatree/doc/samples.html



来源:https://stackoverflow.com/questions/2241464/dynatree-slow-when-dynamically-loaded-with-100-nodes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!