Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable option for gradual expanding of large children arrays #133

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

ssteffl
Copy link
Contributor

@ssteffl ssteffl commented May 6, 2015

angular-tree-control has good performance on large data-sets partially because it onlyrenders children when the parent is toggled open. But it is very slow when a parent has many children (I have on the order of 500 in some instances). On top of that, when I use ng-include for each of the children labels, it causes the browser to freeze for >5 seconds while angular is compiling all 500 of the children nodes

This commit adds a 3 extra options that allow for better rendering. They are turned off by default so original behavior remains the default. The 3 options are:

    enableIntervalToggle: //allow for gradual rendering of the children. false by default
    childrenTimeInterval: //how many ms between renders
    childrenLimitInterval: //how many children to add for each render

For Example, if these were the option values:

    enableIntervalToggle: true
    childrenTimeInterval: 10
    childrenLimitInterval: 10

when a parent node is expanded, it will append 10 children nodes every 10 ms. This will not freeze the screen, and allow the user to still interact with stuff while the children are being added.

I call it enableIntervalToggle because it adds children nodes on an interval when the parent is toggled open.

@mjohnson1122
Copy link

Bravo on this pull request!! Just stumbled on it today as we've been having lots of problems loading large trees. After some trial and error with the childrenTimeInterval and childrenLimitInterval settings, we have trees loading steadily, providing visual cue to the user while still remaining responsive enough if the user wishes to do something else while the tree finishes loading. Good stuff!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants