angular/components
Document creating a custom sort-header control
Closed
#13,177 opened on Sep 18, 2018
P4area: material/sortdocshelp wanted
Repository metrics
- Stars
- (24,044 stars)
- PR merge metrics
- (Avg merge 3d 12h) (98 merged PRs in 30d)
Description
Bug, feature request, or proposal:
Proposal
What is the expected behavior?
Be able to add custom controls to headers along with matSort

What is the current behavior?
It is possible to add custom controls e.g.
<ng-container matColumnDef="to">
<mat-header-cell *matHeaderCellDef>
<div class="vbox">
To
<input [(ngModel)]="filter.to">
</div>
</mat-header-cell>
<mat-cell *matCellDef="let element">{{element.to}}</mat-cell>
</ng-container>
However this does not work with matSort
What are the steps to reproduce?
Providing a StackBlitz reproduction is the best way to share your issue. StackBlitz starter: https://goo.gl/wwnhMV
What is the use-case or motivation for changing an existing behavior?
I need individual filter controls for each column in the table, all the examples use a single filter field.