ion-tree-list icon indicating copy to clipboard operation
ion-tree-list copied to clipboard

Set any subtree as collapsed

Open gsdiama opened this issue 8 years ago • 6 comments

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:

scopetasks

I have tried withouth success. Is that possible?

Thanks in advance!

Yours faithfully,

gsdiama

gsdiama avatar Jan 04 '17 12:01 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 screen shot 2017-01-09 at 11 18 03 pm

nilaykothari90 avatar Jan 10 '17 20:01 nilaykothari90

@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.

nilaykothari90 avatar Jan 10 '17 23:01 nilaykothari90

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?

fer avatar Jan 13 '17 15:01 fer

It works for me. Thanks Fer for the quick help.

nilaykothari90 avatar Jan 14 '17 01:01 nilaykothari90

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?

MinhDT94 avatar Oct 26 '18 07:10 MinhDT94

Sure thing @MinhDT94 .. but cannot reproduce it though :/

Do you mind adding a screenshot, please?

fer avatar Oct 26 '18 08:10 fer