CDataTable: Table content doesn't support specifying the nested JSON in 'fields' props
See original GitHub issueThe CDataTable displays undefined for the column where the “key” is specified in nested JSON. ex:
App.js:
export default function App() {
const data = usersData;
const fields = [{
key: "name",
label: "Name"
},{
key: "available.status",
label: "Available"
}];
return (
<CDataTable
items={data}
fields={fields}
/>
);
}
usersData.js:
export const usersData = [
{
id: 0,
name: "John Doe",
available: {
status: false
}
},
{
id: 1,
name: "Samppa Nori",
available: {
status: true
}
},
{
id: 2,
name: "Estavan Lykos",
available: {
status: false
}
},
{
id: 3,
name: "Chetan Mohamed",
available: {
status: true
}
}
];
The column for “Available” is undefined.
Below you can find the link for working demo of the issue
Operating system and version: Windows 10 Pro Browser and version: All the browsers Reduced test cases : click here
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
CDataTable: Table content doesn't support specifying the nested ...
CDataTable : Table content doesn't support specifying the nested JSON in 'fields' props ... The CDataTable displays undefined for the column where the...
Read more >Access nested JSON in React table - Stack Overflow
And it doesn't seem to contain ownerid . Try accessor: '_links.customer.href' to check whether it outputs anything to the table.
Read more >DataTable - CoreUI
There are two ways to set columns by fields prop: -String: array item define column name equal to item key.
Read more >Datatables get data from nested JSON Object
I was using principal.name to show the principal name on my table, but it's not working. the detail of the code is below...
Read more >RichFaces Developer Guide - JBoss.org
For example: if we use a4j:support on an input field and ... RichFaces allows to serialize not only primitive types into JSON format,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@woothu Please help me with this issue
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions