AdaptTable for Quasar

Column groups in Quasar

A parent with children is a column group: its caption spans its columns in a header row of its own. This table has three, open by default; collapse one to see how it folds.

Assignment is Team + Status with collapsedKey: "team", so it keeps Team. Delivery is Timeline + Budget with collapsedRender, so it draws the budget in one cell. Workload has neither, so it folds to a narrow stub.

collapsibleColumnGroups arms the toggles. The group headers use Quasar buttons.

The code

<script setup lang="ts">
import type { ColumnInput } from "@adapttable/vue";
import { DataTable } from "@adapttable/quasar";
import { collapsibleColumnGroups } from "@adapttable/quasar/column-groups";

interface Member {
  id: string;
  name: string;
  team: string;
  status: string;
  budget: number;
}

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

const columns: ColumnInput<Member>[] = [
  { key: "name", header: "Name" },
  {
    header: "Assignment",
    collapsedKey: "team",
    children: [
      { key: "team", header: "Team" },
      { key: "status", header: "Status" },
    ],
  },
  {
    header: "Budget",
    collapsedRender: (row) => `$${row.budget}`,
    children: [{ key: "budget", header: "Amount" }],
  },
];
const rowKey = (row: Member) => row.id;
const features = [collapsibleColumnGroups()];
</script>

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

Install

pnpm add @adapttable/quasar @adapttable/vue @adapttable/core quasar@2.34.0

The same feature in the other kits

More Quasar features

Reference: column-groups, columns. More of this kit: AdaptTable for Quasar, or the live demo.