AdaptTable for Vuetify

Saved views in Vuetify

A view is the table's state — search, sort, filters and the column layout — saved under a name.

Save one from the views menu and pick it again later to put the table back the way it was. The list lives in this browser's storage, or in any store you hand savedViews.

The code

<script setup lang="ts">
import type { ColumnDef } from "@adapttable/vue";
import { DataTable } from "@adapttable/vuetify";
import { filters } from "@adapttable/vuetify/filters";
import { savedViews } from "@adapttable/vuetify/saved-views";

defineProps<{ rows: readonly Person[] }>();

const columns: ColumnDef<Person>[] = [
  { key: "name", sortable: true },
  { key: "team" },
  { key: "budget", sortable: true },
];
const rowKey = (row: Person) => row.id;
const features = [
  filters<Person>([]),
  savedViews({ storageKey: "people-views", urlKey: "people" }),
];
</script>

<template>
  <DataTable
    :data="rows"
    :columns="columns"
    :row-key="rowKey"
    url-key="people"
    :features="features"
  />
</template>

Install

pnpm add @adapttable/vuetify @adapttable/vue @adapttable/core vuetify

The same feature in the other kits

More Vuetify features

Reference: saved-views, url-state. More of this kit: AdaptTable for Vuetify, or the live demo.