ng-material-treetable
ng-material-treetable copied to clipboard
How can i set default collapse instead of expanding all ?
agreed, this would be a very useful feature
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();
}
}