tree-grid-directive
tree-grid-directive copied to clipboard
Allow tree expanded by default and let free users to expand/collapse rows
#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 !
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.
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 !
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.
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