From cec26f473b7deaa37779866f6fe6454c9b3873ef Mon Sep 17 00:00:00 2001 From: Tyoneb <59046401+Tyoneb@users.noreply.github.com> Date: Sun, 12 Jul 2026 08:46:22 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75185=20[tabulator?= =?UTF-8?q?-tables]=20Fix=20`setHeaderFilterValue`=20method=20signature=20?= =?UTF-8?q?by=20@Tyoneb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Benoit CHOMEL --- types/tabulator-tables/index.d.ts | 2 +- types/tabulator-tables/tabulator-tables-tests.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/types/tabulator-tables/index.d.ts b/types/tabulator-tables/index.d.ts index 408e262a23c681..fd71ead6cc580c 100755 --- a/types/tabulator-tables/index.d.ts +++ b/types/tabulator-tables/index.d.ts @@ -3174,7 +3174,7 @@ declare class Tabulator { getFilters: (includeHeaderFilters?: boolean) => Filter[]; /** You can programmatically set the header filter value of a column by calling the setHeaderFilterValue function, This function takes any of the standard column component look up options as its first parameter, with the value for the header filter as the second option. */ - setHeaderFilterValue: (column: ColumnLookup, value: string) => void; + setHeaderFilterValue: (column: ColumnLookup, value: string | string[]) => void; /** You can programmatically set the focus on a header filter element by calling the setHeaderFilterFocus function, This function takes any of the standard column component look up options as its first parameter. */ setHeaderFilterFocus: (column: ColumnLookup) => void; diff --git a/types/tabulator-tables/tabulator-tables-tests.ts b/types/tabulator-tables/tabulator-tables-tests.ts index 7cca3fd8d3e44f..6398f4eaee7874 100644 --- a/types/tabulator-tables/tabulator-tables-tests.ts +++ b/types/tabulator-tables/tabulator-tables-tests.ts @@ -899,10 +899,22 @@ table = new Tabulator("#example-table", { return value >= params.legalAge; }, accessorHtmlOutputParams: { legalAge: 18 }, + headerFilter: "input", + }, + { + title: "Name2", + field: "name2", + headerFilter: "list", + headerFilterParams: { + multiselect: true, + values: ["value1", "value2", "value3"], + }, }, ], }); const filterVal = table.getHeaderFilterValue("name"); +table.setHeaderFilterValue("name", "value"); +table.setHeaderFilterValue("name2", ["value1", "value3"]); table.recalc(); const columns = table.getColumns(true); columns.forEach(col => col.getDefinition());