Exploring the code snippet utilizing ag-grid with Vue 3.
<script setup lang="ts">
import "ag-grid-community/dist/styles/ag-grid.css";
import "ag-grid-community/dist/styles/ag-theme-alpine.css";
import { AgGridVue } from "ag-grid-vue3";
import { ref } from "vue";
const columnDefs = ref([
{
field: "person",
},
{
field: "car",
},
]);
const rowData = ref([
{
person: "person-1",
car: "car-1",
},
{
person: "person-1",
car: "car-2",
},
{
person: "person-1",
car: "car-3",
},
{
person: "person-2",
car: "car-4",
},
{
person: "person-3",
car: "car-5",
},
{
person: "person-3",
car: "car-6",
},
]);
</script>
<template>
<ag-grid-vue
style="width: 500px; height: 500px"
class="ag-theme-alpine"
:columnDefs="columnDefs"
:rowData="rowData"
>
</ag-grid-vue>
</template>
The above configuration will yield the desired output.
https://i.stack.imgur.com/ioUdd.png
In the presented table, it is possible to group based on the person, but a query arises regarding merging cells in a single column.
https://i.stack.imgur.com/meNOK.png
It appears that implementing row-spanning solely for a single column definition poses challenges as instructing ag-grid to combine multiple cells of a single column within the rowSpan function seems unfeasible. Any suggestions or approaches?