primevue
primevue copied to clipboard
DataTable: Column with dot(.) in the field name is not rendered
Describe the bug
Columns with . (dot) in the field name is not rendered.
Columns:
[
{
"field": "client.name",
"header": "Client name"
}
]
Data:
[
{
"client.name": "First client"
},
{
"client.name": "Second client"
}
]
Issue link: https://github.com/primefaces/primevue/blob/b66ae178bdf7b7740f1ed62ceebe14bde3ab5756/src/components/datatable/BodyCell.vue#L151 https://github.com/primefaces/primevue/blob/8503150b3d42a13a86815b13bec077ef31594c99/src/components/utils/ObjectUtils.js#L65
Is there any way to render it?
Many thanks.
Reproducer
No response
PrimeVue version
3.16.2
Vue version
3.x
Language
ALL
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
Add a flag to allow to use fields with . (dot)
A potential workaround could be something like this:
<Column
field="client.name"
header="Client Name"
>
<template #body="slotProps">
{{ slotProps.data.client.name }}
</template>
</Column>
@emmalouiselane thanks for your contribution. It solves the problem. If the problem still persists, please feel free to open a new issue with codesandbox.