# Custom Filters

Custom filters allow you to integrate your own filters into the plugin using Vue's events system.

#### Client Side Filters&#xD;

A. use the `customFilters` option to declare your filters, following this syntax:

```javascript
customFilters: [{
    name: 'alphabet',
    callback: function (row, query) {
        return row.name[0] == query;
    }
}]
```

B. Then emit the event when appropriate:

Using the event bus:

```javascript
Event.$emit('vue-tables.filter::alphabet', query);
```

[Vue 3](/vue-tables-2/installation/vue-version-3.md) Event Bus:

```javascript
EventBus.emit('vue-tables.filter::alphabet', query);
```

Using Vuex:

```javascript
this.$store.commit('myTable/SET_CUSTOM_FILTER', {filter:'alphabet', value:query})
```

#### Server Side Filters&#xD;

A. use the customFilters option to declare your filters, following this syntax:

```javascript
customFilters: ['alphabet','age-range']
```

B. the same as in the client component.

C. Custom filters will be sent as request parameters. Implement the necessary logic on the server side.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://matanya.gitbook.io/vue-tables-2/custom-filters.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
