ng-material-treetable icon indicating copy to clipboard operation
ng-material-treetable copied to clipboard

How can i set default collapse instead of expanding all ?

Open long20014 opened this issue 5 years ago • 2 comments

long20014 avatar Mar 23 '20 11:03 long20014

agreed, this would be a very useful feature

clement-lpr avatar Jun 12 '20 06:06 clement-lpr

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();
    }
  }

tomaszs avatar Mar 31 '21 14:03 tomaszs