AdaptTable for Quasar

Nested tables in Quasar

Open a row and the panel holds another Quasar table — the same component, not a hand-built list. Each person has recent orders; the inner table has its own columns and row keys.

nestedTable() mounts the kit's DataTable with defaults that keep the two tables from fighting over the URL. Rows with no nested table can still use rowDetail().

The expand chevron and both tables are Quasar.

The code

<script setup lang="ts">
import { h } from "vue";
import type { ColumnDef } from "@adapttable/vue";
import { DataTable } from "@adapttable/quasar";
import { nestedTable } from "@adapttable/quasar/nested-table";

interface Order {
  id: string;
  item: string;
}

interface Customer {
  id: string;
  name: string;
  orders: Order[];
}

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

const columns: ColumnDef<Customer>[] = [{ key: "name" }];
const orderColumns: ColumnDef<Order>[] = [{ key: "item" }];
const rowKey = (row: Customer) => row.id;
const features = [
  nestedTable<Customer>((row) => ({
    label: `Orders for ${row.name}`,
    table: (defaults) =>
      h(DataTable<Order>, {
        ...defaults,
        data: row.orders,
        columns: orderColumns,
        rowKey: (order: Order) => order.id,
      }),
  })),
];
</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: tree-data, row-expansion. More of this kit: AdaptTable for Quasar, or the live demo.