---
title: "Set Filter - Overview"
enterprise: true
framework: vue
version: "36.1.0"
---

# Set Filter - Overview

The Set Filter takes inspiration from Excel's AutoFilter and allows filtering on sets of data.

![Set Filter](https://www.ag-grid.com/_astro/set-filter.BVqbXaVo.png)

## Set Filter Sections

The Set Filter is comprised of the following sections:

- **[Mini Filter](https://www.ag-grid.com/vue-data-grid/filter-set-mini-filter/)**: used to narrow the values available for selection inside the Filter List.
- **Select All**: used to select / deselect all values shown in the Filter List.
- **[Filter List](https://www.ag-grid.com/vue-data-grid/filter-set-filter-list/)**: a list of Set Filter Values which can be selected / deselected to set the filter.
- **[Filter Buttons](https://www.ag-grid.com/vue-data-grid/filter-applying/#apply-clear-reset-and-cancel-buttons)**: Action buttons that can be optionally added to the bottom of the Set Filter.

## Enabling Set Filters

The Set Filter is the default filter used in AG Grid Enterprise (unless it has been [Suppressed by Default](#suppress-set-filter-by-default) or the `SetFilterModule` has not been registered), but it can also be explicitly configured as shown below:

```ts
<ag-grid-vue
    :columnDefs="columnDefs"
    /* other grid options ... */>
</ag-grid-vue>

this.columnDefs = [
    // Set Filter is used by default in Enterprise version
    { field: 'athlete', filter: true },
    // explicitly configure column to use the Set Filter
    { field: 'country', filter: 'agSetColumnFilter' },
];
```

The following example demonstrates how the Set Filter can be enabled. Note the following:

- The **Athlete** column has `filter=true` which defaults to the Set Filter as this example is using AG Grid Enterprise.
- The **Country** column is explicitly configured to use the Set Filter using `filter='agSetColumnFilter'`.
- All other columns are configured to use the [Number Filter](https://www.ag-grid.com/vue-data-grid/filter-number/) using `filter='agNumberColumnFilter'`.
- Filters can be accessed by clicking on the filter icon in the [Floating Filters](https://www.ag-grid.com/vue-data-grid/floating-filters/).

#### Enabling Set Filters

```ts
import {
  createApp,
  defineComponent,
  onBeforeMount,
  ref,
  shallowRef,
} from "vue";
import { AgGridVue } from "ag-grid-vue3";
import {
  ClientSideRowModelModule,
  ColDef,
  ColGroupDef,
  GridApi,
  GridOptions,
  GridReadyEvent,
  ModuleRegistry,
  NumberFilterModule,
  enableDevValidations,
} from "ag-grid-community";
import {
  ColumnMenuModule,
  ColumnsToolPanelModule,
  ContextMenuModule,
  SetFilterModule,
} from "ag-grid-enterprise";
import { IOlympicData } from "./interfaces";
if (process.env.NODE_ENV !== "production") {
  enableDevValidations();
}

ModuleRegistry.registerModules([
  ClientSideRowModelModule,
  ColumnsToolPanelModule,
  ColumnMenuModule,
  ContextMenuModule,
  SetFilterModule,
  NumberFilterModule,
]);

const VueExample = defineComponent({
  template: `
        <div style="height: 100%">
                <ag-grid-vue
      style="width: 100%; height: 100%;"
      @grid-ready="onGridReady"
      :columnDefs="columnDefs"
      :defaultColDef="defaultColDef"
      :rowData="rowData"></ag-grid-vue>
        </div>
    `,
  components: {
    "ag-grid-vue": AgGridVue,
  },
  setup(props) {
    const gridApi = shallowRef<GridApi<IOlympicData> | null>(null);
    const columnDefs = ref<ColDef[]>([
      // set filters
      { field: "athlete", filter: true },
      { field: "country", filter: "agSetColumnFilter" },
      // number filters
      { field: "gold", filter: "agNumberColumnFilter" },
      { field: "silver", filter: "agNumberColumnFilter" },
      { field: "bronze", filter: "agNumberColumnFilter" },
    ]);
    const defaultColDef = ref<ColDef>({
      flex: 1,
      minWidth: 200,
      floatingFilter: true,
    });
    const rowData = ref<IOlympicData[]>(null);

    const onGridReady = (params: GridReadyEvent) => {
      gridApi.value = params.api;

      const updateData = (data) => (rowData.value = data);

      fetch("https://www.ag-grid.com/example-assets/olympic-winners.json")
        .then((resp) => resp.json())
        .then((data) => updateData(data));
    };

    return {
      gridApi,
      columnDefs,
      defaultColDef,
      rowData,
      onGridReady,
    };
  },
});

const app = createApp(VueExample);
app.mount("#app");
```

[Live example: Enabling Set Filters](https://www.ag-grid.com/examples/filter-set/enabling-set-filters/vue3)

## Suppress Set Filter by Default

When `filter = true`, the Set Filter is used for AG Grid Enterprise by default. To use the [Text Filter](https://www.ag-grid.com/vue-data-grid/filter-text/), [Number Filter](https://www.ag-grid.com/vue-data-grid/filter-number/) or [Date Filter](https://www.ag-grid.com/vue-data-grid/filter-date/) instead based on the [Cell Data Type](https://www.ag-grid.com/vue-data-grid/cell-data-types/) (as in AG Grid Community), set the grid option `suppressSetFilterByDefault = true`.

## Set Filter Parameters

Set Filters are configured though the `filterParams` attribute of the column definition (`ISetFilterParams` interface):

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `applyMiniFilterWhileTyping` | `boolean` |  | `false` | Set to `true` to apply the Set Filter immediately when the user is typing in the Mini Filter. See [Keyboard Shortcuts](https://www.ag-grid.com/vue-data-grid/filter-set-mini-filter/#keyboard-shortcuts) for more information. |
| `buttons` | `FilterAction[]` |  |  | Specifies the buttons to be shown in the filter, in the order they should be displayed in. The options are: `'apply'`: If the Apply button is present, the filter is only applied after the user hits the Apply button. `'clear'`: The Clear button will clear the (form) details of the filter without removing any active filters on the column. `'reset'`: The Reset button will clear the details of the filter and any active filters on that column. `'cancel'`: The Cancel button will discard any changes that have been made to the filter in the UI, restoring the applied model. |
| `caseSensitive` | `boolean` |  | `false` | If `true`, enables case-sensitivity in the SetFilter Mini-Filter and Filter List. |
| `cellHeight` | `number` |  |  | The height of values in the Filter List in pixels. |
| `cellRenderer` | `any` |  |  | Similar to the Cell Renderer for the grid. Setting it separately here allows for the value to be rendered differently in the filter. See [Filter List Cell Renderer](https://www.ag-grid.com/vue-data-grid/filter-set-filter-list/#cell-renderer) for more information. |
| `closeOnApply` | `boolean` |  | `false` | If the Apply button is present, the filter popup will be closed immediately when the Apply or Reset button is clicked if this is set to `true`. |
| `comparator` | `Function` |  |  | Comparator for sorting. If not provided, the Column Definition comparator is used. If Column Definition comparator is also not provided, the default (grid provided) comparator is used. See [Sorting Filter Lists](https://www.ag-grid.com/vue-data-grid/filter-set-filter-list/#sorting-filter-lists) for more information. |
| `debounceMs` | `number` |  |  | Overrides the default debounce time in milliseconds for the filter. Defaults are: `TextFilter` and `NumberFilter`: 500ms. (These filters have text field inputs, so a short delay before the input is formatted and the filtering applied is usually appropriate). `DateFilter` and `SetFilter`: 0ms |
| `defaultToNothingSelected` | `boolean` |  |  | By default, when the Set Filter is opened all values are shown selected. Set this to `true` to instead show all values as de-selected by default. This does not work when `excelMode` is enabled. See [Default State](https://www.ag-grid.com/vue-data-grid/filter-set-filter-list/#default-state) for more information. |
| `excelMode` | `'mac' \| 'windows'` |  |  | Changes the behaviour of the Set Filter to match that of Excel's AutoFilter. See [Excel Mode](https://www.ag-grid.com/vue-data-grid/filter-set-excel-mode/) for more information. |
| `keyCreator` | `Function` |  |  | Function to return a string key for a value. This is required when the filter values are complex objects, or when `treeList = true` and the column is a group column with Tree Data or Grouping enabled. If not provided, the Column Definition Key Creator is used. |
| `readOnly` | `boolean` |  | `false` | If set to `true`, disables controls in the filter to mutate its state. Normally this would be used in conjunction with the Filter API. See [Read-only Filter UI](https://www.ag-grid.com/vue-data-grid/filter-api/#read-only-filter-ui) for more information. |
| `refreshValuesOnOpen` | `boolean` |  |  | Refresh the values every time the Set filter is opened. See [Refreshing Values](https://www.ag-grid.com/vue-data-grid/filter-set-filter-list/#refreshing-values) for more information. |
| `showTooltips` | `boolean` |  | `false` | If `true`, hovering over a value in the Set Filter will show a tooltip containing the full, untruncated value. See [Filter Value Tooltips](https://www.ag-grid.com/vue-data-grid/filter-set-filter-list/#filter-value-tooltips) for more information. |
| `suppressClearModelOnRefreshValues` | `boolean` |  |  | By default, if using provided filter values and there is an active filter model, when the filter values are refreshed such that every value is in the filter model, the filter model will be cleared (reset to `null`). To prevent this behaviour, set this property to `true`. This is useful if using SSRM and updating the filter values based on other column filters. |
| `suppressMiniFilter` | `boolean` |  | `false` | Set to `true` to hide the Mini Filter. See [Hiding the Mini Filter](https://www.ag-grid.com/vue-data-grid/filter-set-mini-filter/#hiding-the-mini-filter) for more information. |
| `suppressSelectAll` | `boolean` |  | `false` | Set to `true` to remove the Select All checkbox. |
| `suppressSorting` | `boolean` |  | `false` | If `true`, the Set Filter values will not be sorted. Use this if you are providing your own values and don't want them sorted as you are providing in the order you want. See [Supplying Filter Values](https://www.ag-grid.com/vue-data-grid/filter-set-filter-list/#supplying-filter-values) for more information. |
| `textFormatter` | `Function` |  |  | If specified, this formats the text before applying the Mini Filter compare logic, useful for instance to substitute accented characters. See [Custom Searches](https://www.ag-grid.com/vue-data-grid/filter-set-mini-filter/#custom-searches) for more information. |
| `treeList` | `boolean` |  |  | If `true`, the Set Filter List will be displayed in a tree format. If enabled, one of the following must be true: A `treeListPathGetter` is provided to get the tree path for the column values. The column values are of type `Date`, in which case the tree will be year -> month -> day. Tree Data mode is enabled and the column is the group column. The Filter List will match the tree structure. A Key Creator must be supplied. Grouping is enabled and the column is the group column. The Filter List will match the group structure. A Key Creator must be supplied. See [Tree List](https://www.ag-grid.com/vue-data-grid/filter-set-tree-list/) for more information. |
| `treeListFormatter` | `Function` |  |  | Requires `treeList = true`. If specified, this formats the tree values before they are displayed in the Filter List. `pathKey` - The key for the current node in the tree. `level` - The level of the current node in the tree (starting at 0). `parentPathKeys` - The keys of the parent nodes up until the current node (exclusive). This will be an empty array if the node is at the root level. See [Tree List](https://www.ag-grid.com/vue-data-grid/filter-set-tree-list/) for more information. |
| `treeListPathGetter` | `Function` |  |  | Requires `treeList = true`. If provided, this gets the tree path to display in the Set Filter List based on the column values. Each row must map to a leaf value in the tree. See [Tree List](https://www.ag-grid.com/vue-data-grid/filter-set-tree-list/) for more information. |
| `valueFormatter` | `Function` |  |  | If specified, this formats the value before it is displayed in the Filter List. If a Key Creator is provided (see `keyCreator`), this must also be provided. |
| `values` | `SetFilterValues<TData, V>` |  |  | The values to display in the Filter List. If this is not set, the filter will take its values from what is loaded in the table. See [Supplying Filter Values](https://www.ag-grid.com/vue-data-grid/filter-set-filter-list/#supplying-filter-values) for more information. |

### Updating Set Filter Parameters

When new column definitions are set with updated Set Filter parameters, the Set Filter will update to reflect these. For certain filter parameters, changing the parameter will invalidate the filter model. This will cause the filter to be reset.

The following filter parameters will reset the Set Filter - `treeList`, `treeListPathGetter`, `caseSensitive`, `comparator`, and `excelMode`.

Additionally, a few column definition properties will also reset the Set Filter - `filterValueGetter`, `keyCreator` (unless specified in both the old and new filter parameters), and `valueFormatter` (if no `keyCreator` and the [Cell Data Type](https://www.ag-grid.com/vue-data-grid/cell-data-types/#pre-defined-cell-data-types) is not `'number'` or `'text'`).

For the parameters above which are functions, define them as constants outside of the column definition to avoid resetting the Set Filter when passing new column definitions.
