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

JSON Model items order breaks jsTree #78

Open
LorandLorincz opened this issue May 13, 2016 · 2 comments
Open

JSON Model items order breaks jsTree #78

LorandLorincz opened this issue May 13, 2016 · 2 comments

Comments

@LorandLorincz
Copy link

LorandLorincz commented May 13, 2016

Hi.

When using a JSON as a data source the order of the items in the array matters.
If you have 4 items in like this:
|-level 1
|----level 2
|--------level 3
but the array has them in this order [level1,level3,level2] the level 3 item is not shown.
I forked and modified a plunked: http://plnkr.co/edit/GACPehDOSFaBwaDjeshS

Thanks in advance.
Lori

@ken731025
Copy link

ken731025 commented May 18, 2016

It's is a order problem
$scope.treeData.push({ id : '7', parent : '3', text : 'Missing Node'});
$scope.treeData.push({ id : '3', parent : '2', text : 'Level 2'});
change to:
$scope.treeData.push({ id : '3', parent : '2', text : 'Level 2'});
$scope.treeData.push({ id : '7', parent : '3', text : 'Missing Node'});

It's will show
http://plnkr.co/edit/r9IQrvY7mNPoRUmyt5Ee?p=preview
Ken

@LorandLorincz
Copy link
Author

I know it's an order problem, but in my opinion order should not matter.
My Tree Model is deliverd from a backend service that uses closure tables to emulate the the hierarchy so the order is incosistent, especially after some moves.

This is a ngJsTree bug and not a jsTree bug.

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

No branches or pull requests

2 participants