Skip to content

Commit a4e2b7b

Browse files
committed
Fix for country filter
1 parent da9bcb5 commit a4e2b7b

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/index.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,20 @@ type SearchData = {
3838

3939
const dataUrl = "/iso-4217.json";
4040

41+
function filterCountry(
42+
headerValue: string,
43+
dummyRowValue: any,
44+
rowData: any,
45+
filterParams: any
46+
) {
47+
if (!headerValue || headerValue.length == 0) {
48+
return true;
49+
}
4150

51+
const rowValue = rowData.countries.join(", ");
52+
53+
return filterRegex(headerValue, rowValue, rowData, filterParams);
54+
}
4255

4356
function filterRegex(
4457
headerValue: string,
@@ -377,7 +390,7 @@ async function main() {
377390
field: "countries",
378391
formatter: (cell) => cell.getValue().join(", "),
379392
headerFilter: "input",
380-
headerFilterFunc: filterTags,
393+
headerFilterFunc: filterCountry,
381394
responsive: 0,
382395
title: "Countries",
383396
width: 375,

0 commit comments

Comments
 (0)