Angular Material editable table using FormArray

后端 未结 5 1774
不思量自难忘°
不思量自难忘° 2020-12-14 17:17

I\'m trying to build an inline editable table using the latest material+cdk for angular.

Question

How can I make mat-table use [formG

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-14 17:50

    For matSort to work the type definition is important, at least that's what I found. So with type as any in the code :

    dataSource: MatTableDataSource; 
    

    Will not work. There has to be a type defined here to make it work, try to define a interface and pass it in the generics of MatTableDataSource .

    Also matColumnDef has to match the property name of the defined type.

提交回复
热议问题