Json looks like:
Code: Select all
[
{
"id": 2,
"itemType": "a",
"name": "a",
"description": "a",
"lastEditDate": "16.12.2019 21:37:19",
"user": {
"id": 1,
"userName": "admin",
"password": "***",
"passwordRetype": null,
"role": "ADMIN",
"deactivated": false
}
}
]
Code: Select all
<DataTable :value="itemList" :selection.sync="selectedItem" selection-mode="single">
<column field="id" header="ID"></column>
<column field="name" header="Kennummer / Name"></column>
<column field="itemType" header="Item Typ"></column>
<column field="description" header="Description"></column>
<column field="lastEditDate" header="Last Edit Date"></column>
<column field="user.id" header="Assigned User"></column>
</DataTable>
Code: Select all
Vue warn]: Error in render: "TypeError: Cannot read property 'id' of null"
found in
---> <DataTable> at node_modules/primevue/components/datatable/DataTable.vue
<Anonymous>
<App> at src/App.vue
<Root>
Is there a way to access the nested object "user" with its attributed as column? If not - is there a different way to do this?