树视图绑定性能问题 [英] Tree view binding performance issues

查看:90
本文介绍了树视图绑定性能问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用树形视图使用angularJS显示一些数据。如果我的记录数少于100到200条记录。它工作正常。如果它更多(我的记录实际计数是38,000),我的代码不工作,我的页面卡住并挂在那里。你能帮忙解决一下如何让它变得更好的简单建议吗?



我尝试了什么:



试过服务器端因为条件太多,运行循环并绑定到树视图需要花费大量时间。

我从数据库中获取数据下面。所以a将是我的父母,b,c,d是'a'的孩子。

~a

~a~b

~ a~b~c

~a~b~c~d

Hi All,
I am using tree view to display some data using angularJS. If my record count is less say some 100 to 200 records. It is working fine. if it is morethan that(my record actual count is 38,000), my code is not workinga nd my page is stuck and hanging in there. Can you please help with any simple suggesttion on how to make it better?

What I have tried:

Tried Server side becuase of too many conditions, it is taking lot of time to run the loop and bind to the tree view.
I am getting data from database like below. so a will be my parent, b,c,d are childs to 'a'.
~a
~a~b
~a~b~c
~a~b~c~d

推荐答案

TreeViews使用Hierarchial数据结构。这让你有机会让它快速工作。



诀窍是按需加载子元素(又名:lazy-加载)。换句话说,只加载展开的级别。表演会立刻感受到。 :)



只是看看谷歌搜索,有一些很好的解决方案链接: angularjs treeview load on demand [ ^ ]
TreeViews uses a Hierarchial data structure. This gives you an opportunity to make it work very quickly.

The trick is to load sub-elements on demand (aka: lazy-loading). In other words, only load the expanded level. The performance will feel instant. :)

[edit:] Just had a look at google search and there are some links with some great solutions: angularjs treeview load on demand[^]


这篇关于树视图绑定性能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆