I'm wondering how is it possible to clear a Filter using a Selector as used on the Interactive Demo for the Gender header.
Asked
Active
Viewed 931 times
1 Answers
1
If you are asking how to add an empty option to a select header filter, then you just need to include a property in the headerFilterParams property with the value of an empty string:
{title:"Favourite Color", field:"color", headerFilter:"select", headerFilterParams:{"":"", "red":"red", "green":"green"}}
If you want to trigger it programatically from outside the table then you can call setHeaderFilterValue on the column component
table.getColumn("color").setHeaderFilterValue("");
![](../../users/profiles/3588993.webp)
Oli Folkerd
- 5,658
- 1
- 19
- 35
-
is it possible to ensure an order of the Select header filter? I am having problems with [JS Object Property Order](https://stackoverflow.com/questions/5525795/does-javascript-guarantee-object-property-order) – gtgaxiola Oct 17 '18 at 22:40
-
if you need to guarantee order then you can pass in an array instead of an object [{label:"Male", value:"male"},{label:"Female", value:"female"}] – Oli Folkerd Oct 18 '18 at 06:36