From 61bd7cc2661d74c81f40bdfbbc8afa23b476a258 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 12 Dec 2020 01:54:56 +0100 Subject: [PATCH] Add Boolean Filter --- .../filter-row/filter-row.component.html | 10 ++++++++++ src/app/helperFunctions/customTableFilterFunction.ts | 4 ++++ 2 files changed, 14 insertions(+) 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 a6b27f3..d71cd37 100644 --- a/src/app/components/tableComponents/filter-row/filter-row.component.html +++ b/src/app/components/tableComponents/filter-row/filter-row.component.html @@ -124,3 +124,13 @@ [inputType]="column.type" > + + + + diff --git a/src/app/helperFunctions/customTableFilterFunction.ts b/src/app/helperFunctions/customTableFilterFunction.ts index 8887d04..5053515 100644 --- a/src/app/helperFunctions/customTableFilterFunction.ts +++ b/src/app/helperFunctions/customTableFilterFunction.ts @@ -151,6 +151,10 @@ export function customTableFilterFunction(data: any, filter: any) { if (filterElement.type.startsWith('Enum') && filterElement.value != null && filterElement.value !== data[filterElementName]) { return false; } + // Boolean Filter + if (filterElement.type === "Boolean" && ((filterElement.value === "Ja" && !data[filterElementName])||(filterElement.value === "Nein" && data[filterElementName]))) { + return false; + } } /*const b = !filter.includesString ||