Skip to content

Commit 3b1f0f5

Browse files
docs(VDataTable): update filtering section
resolves #20052
1 parent 24b12d9 commit 3b1f0f5

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

packages/docs/src/examples/v-data-table/prop-filterable.vue renamed to packages/docs/src/examples/v-data-table/prop-filter-keys.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
</v-card-title>
2020

2121
<v-divider></v-divider>
22-
<v-data-table v-model:search="search" :items="items">
22+
<v-data-table
23+
v-model:search="search"
24+
:filter-keys="['name']"
25+
:items="items"
26+
>
2327
<template v-slot:header.stock>
2428
<div class="text-end">Stock</div>
2529
</template>

packages/docs/src/pages/en/components/data-tables/data-and-display.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ The data table exposes a **search** prop that allows you to filter your data.
2626

2727
<ExamplesExample file="v-data-table/prop-search" />
2828

29-
### Filterable
29+
### Filter Keys
3030

31-
You can easily disable specific columns from being included when searching through table rows by setting the property **filterable** to false on the header item(s). In the example below the dessert name column is no longer searchable.
31+
You can easily select only the column you want to filter on by using the **filter-keys** prop. This prop accepts an array of keys from the table items that will be used for filtering. You may also choose to disable columns from filtering by setting the **filter** property to `false` on the header item(s). In the example below the we only filter on the `name` column.
3232

33-
<ExamplesExample file="v-data-table/prop-filterable" />
33+
<ExamplesExample file="v-data-table/prop-filter-keys" />
3434

3535
### Custom filter
3636

@@ -40,7 +40,7 @@ You can override the default filtering used with the **search** prop by supplyin
4040
(value: string, query: string, item?: any) => boolean | number | [number, number] | [number, number][]
4141
```
4242

43-
In the example below, the custom filter will only match inputs that are in completely in upper case.
43+
Additionally, you may apply customize the filtering on a per column basis by setting custom function to the **filter** property on the header item(s). In the example below, the custom filter will only match inputs that are in completely in upper case.
4444

4545
<ExamplesExample file="v-data-table/prop-custom-filter" />
4646

0 commit comments

Comments
 (0)