Skip to content
This repository has been archived by the owner on Apr 5, 2021. It is now read-only.

Set any subtree as collapsed #46

Open
gsdiama opened this issue Jan 4, 2017 · 6 comments
Open

Set any subtree as collapsed #46

gsdiama opened this issue Jan 4, 2017 · 6 comments
Assignees

Comments

@gsdiama
Copy link

gsdiama commented Jan 4, 2017

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

@fer fer self-assigned this Jan 5, 2017
@nilaykothari90
Copy link

nilaykothari90 commented Jan 10, 2017

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
Copy link

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

@fer
Copy link
Owner

fer commented Jan 13, 2017

Hi @gsdiama ,

I've updated @nilaykothari90 's issue #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:

5be7a8d

Could you please @gsdiama confirm this is solving your issue too?

@nilaykothari90
Copy link

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

@MinhDT94
Copy link

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?

@fer
Copy link
Owner

fer commented Oct 26, 2018

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

Do you mind adding a screenshot, please?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants