mat-table

Is it possible to create an angular material mat-table component with extra directives but still keep columns dynamic?

跟風遠走 提交于 2021-01-07 06:21:18
问题 Is there a way to extend a mat-table that automatically includes the matSort directive (and other custom directives that interact with the columns, like filter) and still have the content inside hold the mat-sort-header directives? <mat-table [matSortActive]="sortActive" [matSortDirection]="sortDirection" matSort> <ng-content></ng-content> </mat-table> Here is an example: https://stackblitz.com/edit/angular-bxsavu. I've tried creating a component on its own that just puts <ng-content> inside

Angular Material mat-table define reusable column in component

一个人想着一个人 提交于 2020-12-30 08:00:36
问题 Anybody know if it is possible to create a “column” component for use with mat-table, I have tried creating a component for a commonly used column definition but when adding to the table i get an error that was unable to find the column selector, my column definition is below: @Component({ selector: 'iam-select-column', template: ` <ng-container matColumnDef="select"> <mat-header-cell *matHeaderCellDef> <mat-checkbox></mat-checkbox> </mat-header-cell> <mat-cell *matCellDef="let row"> <mat

How to implement filtering in my own DataTable in Angular?

走远了吗. 提交于 2020-07-23 06:45:57
问题 I'm having problems with filters. I decided to implement my personal datasource and not to use the MatTableDataSource and therefore I don't have the filter method available. I can capture the event from the HTML and then pass it to the component and from the component pass it to the datasource. The only problem is that even if the filter is received, the table does not update as if there were no event emitter that I don't know how to implement. For example, if I insert the filter and change

How to implement filtering in my own DataTable in Angular?

半腔热情 提交于 2020-07-23 06:43:44
问题 I'm having problems with filters. I decided to implement my personal datasource and not to use the MatTableDataSource and therefore I don't have the filter method available. I can capture the event from the HTML and then pass it to the component and from the component pass it to the datasource. The only problem is that even if the filter is received, the table does not update as if there were no event emitter that I don't know how to implement. For example, if I insert the filter and change

create dynamic mat-table like math matrix with angular material

左心房为你撑大大i 提交于 2020-07-04 04:20:05
问题 I have one problem on create table. My struct data is dynamic,that means number of row and column is variable like matrix m*n . and struct is available on here. I want to show json (above photo) to mat-table .but I can't correctly assign data to table and it show Duplicate data on table.show column0 for all rows of mat-table. while Correct data in table should be My code is available on stackblitz. in this code,i want create table with 5 col and 6 row. how can i solve it and show all data in

Angular 6: mat-table [dataSource] renders only first record from data array

£可爱£侵袭症+ 提交于 2020-04-30 06:33:22
问题 I want to list a records in mat-table format. My array of data is as below in this screenshot. As seen in the image console log it has two records but in table listing it displays only first record. Here is my component in which i am getting records from the api services. As i am getting records through the array.map() so i am pushing the records into the array variable and have called my function into ngAfterViewInit() life cycle method. export class RecordComponent implements OnInit,