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

Allow tree expanded by default and let free users to expand/collapse rows #152

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Lilipi
Copy link

@Lilipi Lilipi commented Jan 11, 2018

#53

  • In your controller, just before pushing your data into your tree do this :
response.init = true;
response.expandAll = true;
$scope.tree_data = response;
  • In your controller, add this $on :
$rootScope.$on("expandedInit", function() {
	$scope.tree_data.init = false;
})

Hope this helps !

@reem80
Copy link

reem80 commented Jan 24, 2018

Hello Lilipi ,
thanska lot. It helped me to solve my problem. I have another question regarding ng repeat in the template.
When I try to load my tree again, it gives me an error
Error: ngRepeat:dupes
Duplicate Key in Repeater

do you have any idee how to solve this?
Thanks and regards.
Reem.

@Lilipi
Copy link
Author

Lilipi commented Jan 25, 2018

Hello reem80,

You said you "load your tree again", does it mean that you update your data in it ?
Are your sure you haven't duplicate data in your tree ? (rows that have the same key)
Do you clear your tree's data before loading it again ?

Have a good day !

@reem80
Copy link

reem80 commented Jan 25, 2018

Hello Lilipi,

I m sure that my data is not duplicated. The problem occures when I use track by row.branch.uid.
When I change to track by $index the data is loaded in my tree but duplicated.
Is there any way to clean my ng-repeat? I do also tree_data.length=0 before inserting again.
Thanks a lot for your help.

Regards.
Reem.

@Lilipi
Copy link
Author

Lilipi commented Jan 29, 2018

Hello reem80,
It seems that you're data are really duplicated if you see it duplicated in your tree. So it's normal that your ng-repeat doesn't work on uid (duplicated) whereas it works with $index (unique for each row).

Did you try tree_data = [] before inserting again ?
Are you sure your treatment doesn't return duplicated data ?

Emilie

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.

2 participants