angular-tree-component
angular-tree-component copied to clipboard
[Feature] Virtual Scroll loads Async Data
I've got trees with thousands of values at a single level.
I need to load the first 50 or so values, then, when the user scrolls to the bottom of those values, the next 50 are loaded via web request.
Is there any way to do this currently? Really i just need a function to be called when we reach the bottom of the existing list, sort of like getChildren is called when a user expands a node.
Hi,
Any progress on this?
I am trying to:
- mock node index array returned in TreeNodeCollectionComponent ngOnInit react expression
- Find way to mock visibleNodes indexes based on new total filed (currently static) in TreeVirtualScroll
- Create TreeNodeModel array in react effect method and refresh state of TreeModel
Is this good way to go to enable virtual scroll Async Data, any suggestion would be appreciated.
Best regards, Ivan
I need exactly the above mentioned use case. Also the async data should load parent & child level independently.What i'm trying to achieve here is for instance,
- root level nodes count is 5000 , so i need to load all these lazily with the subset of data which occupies available viewport(let say 20 at a time).On scroll need to fetch next 20 nodes from server and do continue.
- By toggling any root node which has the property 'hasChildren' to true, Need to fetch only children nodes of count 20(by passing the parent node id and assume 1000 children nodes are available).On scroll need to fetch next 20 nodes from server and do continue.
@adamkleingit Can you comment on my use case like ,
- is this possible using this component ?
- If possible can you give some example to refer?
I've got trees with thousands of values at a single level.
I need to load the first 50 or so values, then, when the user scrolls to the bottom of those values, the next 50 are loaded via web request.
Is there any way to do this currently? Really i just need a function to be called when we reach the bottom of the existing list, sort of like getChildren is called when a user expands a node.
@charles221133 I have found the solution for the same issue. I have used ngx-infinite-scroll pkg ( https://github.com/orizens/ngx-infinite-scroll.git) and accomplished the tree nodes infinite scrolling. I just want to update my solution here.If anybody wants further sample then i can provide stackblitz.