ion-tree-list
ion-tree-list copied to clipboard
Set any subtree as collapsed
Hi,
First of all thank you for your plugin.
I'm trying to show some subtrees as collapsed and another ones as not collapsed.
For that I would like to set the call as:
And in the $scope.tasks:
I have tried withouth success. Is that possible?
Thanks in advance!
Yours faithfully,
gsdiama
Hi Fer, Thanks a lot for the ionic-tree plugin. I have created dynamic tree structure with the help of your plugin. I have similar issue like #46. When I click on root item it opens up all sub items. But I am not able to navigate level-by-level.
Attached file. I want to have the highlighted section to be collapsed when I open root item but so far no success. Here is my object.
$scope.tasks = []; var objs = []; var obj = { name: 'first task 1.1', tree: [ { name: 'first task 1.1.1', } ] } objs.push(obj); var item = { category: "category", tree: objs }; ($scope.tasks).push(item);
Thanks,
Nilay
@gsdiama :: The approach that you suggested is not possible because the collapsed object is generated in the ion-tree JS file so it does not care what collapsed value you pass in the task variable.
Hi @gsdiama ,
I've updated @nilaykothari90 's issue https://github.com/fer/ion-tree-list/issues/23
I have added an extra attribute to the directive (collapsedLevel) in order to collapse certain levels of the tree:
<ion-tree-list items="tasks" collapsed="collapse" collapsed-level="2" template-url="{{customTemplate}}"></ion-tree-list>
I haven't released a new version since I'd like to test it a bit more in depth, but you can find the changes under the collapsedLevel-attribute branch on github:
https://github.com/fer/ion-tree-list/commit/5be7a8d0f657fb5d997f654bcf378414ec9762a9
Could you please @gsdiama confirm this is solving your issue too?
It works for me. Thanks Fer for the quick help.
Hi @fer, thanks a lot for the ionic-tree plugin, collapsedLevel-attribute is work well when level is 3 and 4, but level 5 it didn't work, can you help me fix this?
Sure thing @MinhDT94 .. but cannot reproduce it though :/
Do you mind adding a screenshot, please?