AdaptTable for Vue Unstyled

Row grouping in Vue Unstyled

Compose groupingPanel(groupBy) and rows start nested by Team then Status. Drag a column header into the strip or add a level from its select, and reorder the levels by dragging a chip or with the arrow keys on its handle; every move is announced.

Each group header folds its rows and shows its row count and the totals its columns declare as aggregatable — Budget sums here, and the panel changes the operation. The grouping travels in the URL.

The code

<script setup lang="ts">
import type { ColumnDef } from "@adapttable/vue";
import { DataTable } from "@adapttable/vue-unstyled";
import { groupingPanel } from "@adapttable/vue-unstyled/grouping-panel";

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

const columns: ColumnDef<Person>[] = [
  { key: "name" },
  { key: "team" },
  { key: "status" },
  { key: "budget", aggregatable: { operations: ["sum", "avg"] } },
];
const rowKey = (row: Person) => row.id;
const features = [groupingPanel(["team", "status"])];
</script>

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

Install

pnpm add @adapttable/vue-unstyled @adapttable/vue @adapttable/core

The same feature in the other kits

More Vue Unstyled features

Reference: row-grouping, pinned-summary-rows, row-reordering. More of this kit: AdaptTable for Vue Unstyled, or the live demo.