first of all: PrimeVue is great. Thanks for your work.
I'm experiencing a problem and can't find a solution googling, checking the docs or this forum.
I try to create columns inside a row of a columngroup dynamically.
Here's how I tried to realize this.
Code: Select all
<DataTable :value="calcValues">
<template #header>
{{ someCalculatedHeaderValue }}
</template>
<ColumnGroup type="header">
<Row>
<Column header="Values / Years" />
<!-- Here starts the problem -->
<Column v-for="n of numberOfYears" :key="n">
<template #body>{{ calcHeadingPerYear(n) }}</template>
</Column>
<!-- Here ends the problem -->
</Row>
</ColumnGroup>
<Column field="rowHeading" />
<Column v-for="n of getNumberOfColumns" :key="n">
<template #body="slotProps">
{{ slotProps.data.values[n].value}}
</template>
</Column>
</DataTable>
The browser console tells me: "Uncaught (in promise) TypeError: Array.prototype.filter called on null or undefined"
I also tried to wrap the <Column> inside a <div v-for="n of numberOfYears" :key="n"></div>, but with the same result.
Could you please give me a hint how to solve this?
Kind regards,
riverman