AdaptTable for Quasar

Aggregation in Quasar

aggregate() computes the table footer and each team's groupAggregates; groupFooters closes each team with its subtotal.

Search the table and group totals and the footer recompute from matching rows. The host-owned portfolio total uses pinnedSummaryRows and remains above the scrolling body, independent of filtering and sorting.

All three surfaces render through the same Quasar controls on desktop and in phone cards.

The code

<script setup lang="ts">
import { computed } from "vue";
import { aggregate, type ColumnDef } from "@adapttable/vue";
import { DataTable } from "@adapttable/quasar";
import { groupingPanel } from "@adapttable/quasar/grouping-panel";
import { pinnedSummaryRows } from "@adapttable/quasar/pinned-summary-rows";

const props = defineProps<{
  rows: readonly Person[];
  totals: readonly Person[];
}>();

const columns: ColumnDef<Person>[] = [
  { key: "name" }, { key: "team" }, { key: "budget" },
];
const rowKey = (row: Person) => row.id;
const budgetSum = aggregate<Person>({ budget: "sum" });
const features = computed(() => [
  groupingPanel<Person>("team", {
    groupAggregates: budgetSum, groupFooters: true,
  }),
  pinnedSummaryRows<Person>({ top: props.totals }),
]);
</script>

<template>
  <DataTable
    :data="rows" :columns="columns" :row-key="rowKey"
    :summary-row="budgetSum" :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: row-grouping, pinned-summary-rows, full-width-rows. More of this kit: AdaptTable for Quasar, or the live demo.