I see in the documentation about how to toggle displaying a row detail but I haven't been able to find anywhere how to always display row detail for every row. Is this even possible?
2
votes
1 Answers
3
votes
Maybe someone is still searching for the solution...
Yes of course, this is possible. fist make sure that your ngx-datatable instance have a template reference:
<ngx-datatable
#myTable
class="material"
[columnMode]="'force'"
[headerHeight]="50">
than in your typeScript code take this reference with ViewChild selector:
@ViewChild('myTable') table: any;
now you can collapse or expand all the rows of the table within the api of ngx-datatable in your TypeScript code:
this.table.rowDetail.collapseAllRows();
this.table.rowDetail.expandAllRows();
or wherever you want in the template:
(click)="table.rowDetail.collapseAllRows()"
(click)="table.rowDetail.expandAllRows()"
Hope this is helpful.