Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular material table with a tree

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?

like image 271
Стас Рябцев Avatar asked Jun 18 '18 16:06

Стас Рябцев


1 Answers

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

like image 194
rrr Avatar answered Oct 05 '22 06:10

rrr