mat-table

Insert a component into another parent component and pass data

随声附和 提交于 2021-02-19 04:17:08
问题 Is it possible to insert a component into another parent component and pass data to the child component from the parent component? User Component Table Component Detail Component in user.html <app-table> <app-detail></app-detail> </app-table> in table.html <div *ngFor="let item of items"> <ng-content [item]="item"></ng-content> (its my problem) </div> 回答1: You can use ngTemplateOutlet : https://angular.io/api/common/NgTemplateOutlet <app-user> <app-table [cardTemplate]="pCard"></app-detail> <

Insert a component into another parent component and pass data

左心房为你撑大大i 提交于 2021-02-19 04:12:19
问题 Is it possible to insert a component into another parent component and pass data to the child component from the parent component? User Component Table Component Detail Component in user.html <app-table> <app-detail></app-detail> </app-table> in table.html <div *ngFor="let item of items"> <ng-content [item]="item"></ng-content> (its my problem) </div> 回答1: You can use ngTemplateOutlet : https://angular.io/api/common/NgTemplateOutlet <app-user> <app-table [cardTemplate]="pCard"></app-detail> <

Inline text editing with Mat-table:

耗尽温柔 提交于 2021-02-18 17:54:26
问题 Does anyone have a good solution to adding inline text editing to a column where you can edit and save and re-edit with mat table like in this example: https://material.io/design/components/data-tables.html#behavior it look like it's still an open issue on gitHub: https://github.com/angular/material2/issues/5982 回答1: inside your matColumnDef you should have a <th></th> and a <td></td> , simply add input to the <td></td> with reactive forms. if you wish it to be practically the same as the

Inline text editing with Mat-table:

五迷三道 提交于 2021-02-18 17:52:08
问题 Does anyone have a good solution to adding inline text editing to a column where you can edit and save and re-edit with mat table like in this example: https://material.io/design/components/data-tables.html#behavior it look like it's still an open issue on gitHub: https://github.com/angular/material2/issues/5982 回答1: inside your matColumnDef you should have a <th></th> and a <td></td> , simply add input to the <td></td> with reactive forms. if you wish it to be practically the same as the

Angular Material Table: custom sort foler and file items

梦想的初衷 提交于 2021-02-08 10:12:27
问题 I have different types of items in my mat-table : Files and Folders. They have to get sorted like in Microsofts file-explorer. Folders can`t be separated from folders and likewise with files. All other sorting rules staying the same. Has anyone an idea how to solve this? Thank you in advance! 回答1: You will have to overwrite the sortData on your MatTableDataSource attached to the table. This is the function that is responsible for sorting records, e.g. this.dataSource.sortData = (data:

Angular Material Table: custom sort foler and file items

China☆狼群 提交于 2021-02-08 10:12:21
问题 I have different types of items in my mat-table : Files and Folders. They have to get sorted like in Microsofts file-explorer. Folders can`t be separated from folders and likewise with files. All other sorting rules staying the same. Has anyone an idea how to solve this? Thank you in advance! 回答1: You will have to overwrite the sortData on your MatTableDataSource attached to the table. This is the function that is responsible for sorting records, e.g. this.dataSource.sortData = (data:

Left sticky columns disappear when scrolling horizontally mat-table with too many columns are present

一曲冷凌霜 提交于 2021-02-08 09:53:42
问题 When scrolling horizontally mat-table, row does not expand to the end of column, just columns that are present on the screen. Because of that, when horizontal scrolling to the right, when mat-row goes out of screen, left sticky columns also leaves (see black border that are present on bottom of mat-row). Url example link: https://stackblitz.com/edit/angular-ddqxvn Is it possible to expand mat-row to all columns (even does that are out of screen), which will keep sticky columns on the left. I

Left sticky columns disappear when scrolling horizontally mat-table with too many columns are present

笑着哭i 提交于 2021-02-08 09:53:41
问题 When scrolling horizontally mat-table, row does not expand to the end of column, just columns that are present on the screen. Because of that, when horizontal scrolling to the right, when mat-row goes out of screen, left sticky columns also leaves (see black border that are present on bottom of mat-row). Url example link: https://stackblitz.com/edit/angular-ddqxvn Is it possible to expand mat-row to all columns (even does that are out of screen), which will keep sticky columns on the left. I

Angular Material Table spitted headers add the sticky header functions

安稳与你 提交于 2021-01-07 06:57:06
问题 I am having the spitted header angular material table and I was looking for help to add the sticky header. I have tried to using sticky: true but somehow it is not working for my first column (as I am hiding the column.) And for the first rows. It is showing the second row. Below is my table When I go with the dropdown only these headers get sticky behavior than others. Below is my stackblitz. https://stackblitz.com/edit/angular-bklajw-5foa62 回答1: To make the top header sticky add sticky tag

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

穿精又带淫゛_ 提交于 2021-01-07 06:22:38
问题 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