Add enum Filter

master
Max 4 years ago
parent 1ee312b070
commit a4fa0b0599

@ -51,6 +51,7 @@
[required]="required" [required]="required"
[disabled]="!editable" [disabled]="!editable"
> >
<mat-option [value]="null"></mat-option>
<mat-option *ngFor="let option of enumValues" [value]="option"> <mat-option *ngFor="let option of enumValues" [value]="option">
{{ option }} {{ option }}
</mat-option> </mat-option>
@ -111,9 +112,7 @@
</mat-form-field> </mat-form-field>
<ng-template #nonEditableText> <ng-template #nonEditableText>
<ng-container *ngFor="let link of value"> <ng-container *ngFor="let link of value">
<a mat-button color="primary" [href]="link">{{ <a mat-button color="primary" [href]="link">{{ link }}</a>
link
}}</a>
</ng-container> </ng-container>
</ng-template> </ng-template>
</div> </div>

@ -114,3 +114,13 @@
> >
</app-date-range-cell> </app-date-range-cell>
</ng-container> </ng-container>
<!-- DateRange Filter -->
<app-cell
*ngIf="column.type.startsWith('Enum')"
[editable]="true"
[(value)]="filter.value"
(valueChange)="newFilterValue()"
[inputType]="column.type"
>
</app-cell>

@ -147,6 +147,10 @@ export function customTableFilterFunction(data: any, filter: any) {
return false; return false;
} }
} }
// Enum Filter
if (filterElement.type.startsWith('Enum') && filterElement.value != null && filterElement.value !== data[filterElementName]) {
return false;
}
} }
/*const b = /*const b =
!filter.includesString || !filter.includesString ||

Loading…
Cancel
Save