7
votes

I can not find an example of a table in a material with a tree (https://material.angular.io/components/table/examples). There is a separate table (MatTableModule) and a tree (MatTreeModule), but I need that the table can be opened as a tree. In most components of the tables, there is such an opportunity (https://ggmod.github.io/angular-2-data-table-demo/), but is it really not in the material? Can anyone seen an example? And how do you think it will be difficult to introduce a tree into the material table?

1
Did you find anything to solve your question ?Bozhinovski

1 Answers

5
votes

You can create a tree like table using the existing MatTable with the help of TreeControl which help you traverse your data and manage expansion state.

This is the example - https://stackblitz.com/edit/angular-m77g7e-semvxp?file=app%2Ftable-basic-example.ts

This is something I have created from above example