Skip to content

Commit

Permalink
add documentation for column filters
Browse files Browse the repository at this point in the history
  • Loading branch information
LrxGaelle committed Mar 18, 2024
1 parent 15498cb commit 1c1d6a1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/web/views/Components/Table/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
return fullNameA < fullNameB ? 1 : -1;
},
{ id: "age", label: "Age", width: "64px", sortable: true, defaultSortOrder: "asc" },
{ id: "tags", label: "Tags", width: "200px", align: "center", filter: true },
{ id: "country", label: "Country", width: "200px", align: "center", sortable: true, defaultSortOrder: "asc" }
];
</pre>
Expand Down Expand Up @@ -331,6 +332,13 @@ export default {
sortable: true,
defaultSortOrder: "asc",
},
{
id: "tags",
label: "Tags",
width: "200px",
align: "center",
filter: true,
},
{
id: "country",
label: "Country",
Expand All @@ -345,36 +353,42 @@ export default {
firstName: "John",
lastName: "Doe",
age: 26,
tags: "Tag 4",
country: "Germany",
},
{
firstName: "Jane",
lastName: "Doe",
age: 21,
tags: "Tag 2",
country: "Austria",
},
{
firstName: "Martine",
lastName: "Durand",
age: 35,
tags: "Tag 1",
country: "France",
},
{
firstName: "Giuseppe",
lastName: "Bompiani",
age: 64,
tags: "Tag 1",
country: "Italy",
},
{
firstName: "Enrico",
lastName: "Fermi",
age: 41,
tags: "Tag 1",
country: "Italy",
},
{
firstName: "Lev Davidovitch",
lastName: "Landau",
age: 23,
tags: "Tag 3",
country: "Russia",
},
],
Expand Down
5 changes: 5 additions & 0 deletions src/web/views/Components/Table/columns-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@ export default [
"Function",
"Set a custom sort function for the column. If not specified, the default sort function will be used.",
],
[
"filter",
"Boolean",
"If you want to filter the column, set this to true. Sortable by id value.",
],
];
4 changes: 4 additions & 0 deletions src/web/views/Components/Table/slots-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ export default [
[
"placeholder",
"Use this slot to add a custom placeholder when the table is empty."
],
[
"column-filters",
"Use this slot to add custom filters for the table."
]
];

0 comments on commit 1c1d6a1

Please sign in to comment.