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

How can i set default collapse instead of expanding all ? #46

Open
long20014 opened this issue Mar 23, 2020 · 2 comments
Open

How can i set default collapse instead of expanding all ? #46

long20014 opened this issue Mar 23, 2020 · 2 comments

Comments

@long20014
Copy link

No description provided.

@clement-lpr
Copy link

agreed, this would be a very useful feature

@tomaszs
Copy link

tomaszs commented Mar 31, 2021

It would be great to have this feature. However, there is a really nice way to fix it. It clicks all collapse icons causing everything to fold :)

  ngAfterViewInit() {
    this.collapseRows();
  }

  collapseRows() {
    const collapsors = document.getElementsByTagName('mat-icon');
    // tslint:disable-next-line: prefer-for-of
    for (let i = 0; i < collapsors.length; i++) {
      const collapsor = collapsors[i] as HTMLElement;
      collapsor.click();
    }
  }

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

No branches or pull requests

3 participants