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

Tree not collapsing #6

Open
leawp opened this issue Feb 1, 2019 · 1 comment
Open

Tree not collapsing #6

leawp opened this issue Feb 1, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@leawp
Copy link

leawp commented Feb 1, 2019

I have the following structure in my project and the first ng-treetable is not collapsing I can collapse the second component no problem.
issue

As you can see I clicked on the second row but it didn't collapse these two tables are in a single component like so:

export class TasksComponent implements OnInit {
    chargeableTasks= taskTree;
    chargeableTasks2 = taskTree; // same object
    constructor() { }

    ngOnInit(): void { }
}
<mat-tab label="Chargeable">
        <div>
            <ng-treetable [tree]="chargeableTasks" id="xd">
            </ng-treetable>
        </div>
        <div>
            <ng-treetable [tree]="chargeableTasks2" id="xd2">
            </ng-treetable>
        </div>
</mat-tab>

So they reference the same object "taskTree" I imagine someone would need that for comparing two nodes of the same tree in split view or something.... Not sure if its a big issue since you can clone the object and be fine.

@mlrv
Copy link
Owner

mlrv commented Feb 1, 2019

Hi @pawelhandrysik thanks for reporting this. I think you are right, I very much suspect that the issue is caused by the object being the same in both trees. As you said, the immediate workaround is to clone the object and use separate copies, but there might be a use case where the original copy needs to be used in both trees. I'll try and see if I can come up with something.

@mlrv mlrv added the enhancement New feature or request label Feb 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants