AdaptTable for Vuetify

Row selection in Vuetify

Tick rows one at a time or take the whole page from the header box, then every matching row from the banner that offers it. The selection is a set of ids rather than a slice of what is rendered, so a row chosen on page one is still chosen while page two is on screen.

Bulk actions run against that set and report back through your own handler — the table never performs the write. This page writes what each action received under the table.

The code

<script setup lang="ts">
import type { ColumnDef } from "@adapttable/vue";
import { DataTable } from "@adapttable/vuetify";
import { bulkActions } from "@adapttable/vuetify/bulk-actions";

defineProps<{ rows: readonly Person[] }>();
const emit = defineEmits<{ archive: [ids: string[]] }>();

const columns: ColumnDef<Person>[] = [
  { key: "name", sortable: true },
  { key: "team" },
  { key: "budget", sortable: true },
];
const rowKey = (row: Person) => row.id;
const features = [
  bulkActions([
    { key: "archive", label: "Archive", onClick: (ids) => emit("archive", ids) },
  ]),
];
</script>

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

Install

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

The same feature in the other kits

More Vuetify features

Reference: selection. More of this kit: AdaptTable for Vuetify, or the live demo.