Issue
Im doing a table with materiwl where is required to have a filter input for each column on the header. The code is below and the problem is that while triggering the input for searching the sorting is also trigered.
Its any way not to trigger sorting while try to insert into the input field.
Solution
add this (click)="$event.stopPropagation();" on your filter input
<ng-container *ngIf="currentField.key != 'check';else second">
<th mat-header-cell *matHeaderCellDef mat-sort-header>
{{ currentField.name}}
<input
type="search"
(click)="$event.stopPropagation();"
(keyup)="filter($event.target.value, I)" (keydown.space)="$event.stopPropagation()"
/>
</th>
<td mat-cell *matCellDef="let element">
<formly-field [field]="element.fieldGroup[i]"></formly-field>
</td>
</ng-container>
Answered By - cfprabhu
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.