ng2-tree
ng2-tree copied to clipboard
Tree always collapses when using NGRX
Hi @rychkog
I installed the new version and unfortunately I'm still experiencing difficulties using the tree. I'm loading children using Ngrx and when I load the next level the tree is collapsing back to the root node.
I found out that the setter _setFoldingType()
int tree.ts
calls to childrenShouldBeLoaded()
and if this function returns true the node is collapsed.
The childrenShouldBeLoaded()
calls to childrenWereLoaded()
and here is the problem the check if the children are loaded is made only by checking the this._childrenLoadingState
. while loading children using ngrx this loading state is never changed (the whole tree is changes) so the childrenWereLoaded()
returns false although the children exists.
I temporary overcame this issue by adding the check !!this._children
and it seems to work. Unfortunately I'm not that familiar with the source code to know if i messed up something else.
Can you please check it out?
Thanks, TMaster
Hi @rychkog Have you had a chance to look at the problem, it drives people here crazy,
If there something I can do to expedite the progress please tell me.
Thanks,
Hi @rychkog , any news? Thanks
@TMaster I've understood the problem. Will work on this.
Thanks, a lot
any news about this ?
thanks
i tried solution proposed by @TKul6, it works only for first level of tree ..the other nodes need one more click for loading, moreover adding the control on !!this._children requires the modification of the library and it is not a solution. Does anyone have a solution for this issue??