From a4fa0b05994c7284e5e8cf06fecc099149633661 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 12 Dec 2020 01:46:37 +0100 Subject: [PATCH] Add enum Filter --- .../tableComponents/cell/cell.component.html | 5 ++--- .../filter-row/filter-row.component.html | 10 ++++++++++ src/app/helperFunctions/customTableFilterFunction.ts | 4 ++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/app/components/tableComponents/cell/cell.component.html b/src/app/components/tableComponents/cell/cell.component.html index dd76e27..a4a11fd 100644 --- a/src/app/components/tableComponents/cell/cell.component.html +++ b/src/app/components/tableComponents/cell/cell.component.html @@ -51,6 +51,7 @@ [required]="required" [disabled]="!editable" > + {{ option }} @@ -111,9 +112,7 @@ - {{ - link - }} + {{ link }} diff --git a/src/app/components/tableComponents/filter-row/filter-row.component.html b/src/app/components/tableComponents/filter-row/filter-row.component.html index 6c6c45a..a6b27f3 100644 --- a/src/app/components/tableComponents/filter-row/filter-row.component.html +++ b/src/app/components/tableComponents/filter-row/filter-row.component.html @@ -114,3 +114,13 @@ > + + + + diff --git a/src/app/helperFunctions/customTableFilterFunction.ts b/src/app/helperFunctions/customTableFilterFunction.ts index 7d0b440..8887d04 100644 --- a/src/app/helperFunctions/customTableFilterFunction.ts +++ b/src/app/helperFunctions/customTableFilterFunction.ts @@ -147,6 +147,10 @@ export function customTableFilterFunction(data: any, filter: any) { return false; } } + // Enum Filter + if (filterElement.type.startsWith('Enum') && filterElement.value != null && filterElement.value !== data[filterElementName]) { + return false; + } } /*const b = !filter.includesString ||