This repository was archived by the owner on Jun 28, 2021. It is now read-only.
This repository was archived by the owner on Jun 28, 2021. It is now read-only.
[DataTable] accept nested objects in "rows" array #498
Open
Description
Currently we need to connect data in "rows" prop of DataTable component with TableHeader's "name" prop to work properly. But having nested object in "rows" array will not connect them and sort.
Example of how now works:
const data = [{email: 'test@test.com', name: 'Alex'}];
<DataTable rows={data}>
<TableHeader name="email">Email</TableHeader>
<TableHeader name="name">Name</TableHeader>
</DataTable>
And how does not work:
const data = [{email: 'test@test.com', profile: { name: 'Alex' }}];
<DataTable rows={data}>
<TableHeader name="email">Email</TableHeader>
<TableHeader name="name">Name</TableHeader>
</DataTable>
I suggest to type object keys like "profile.name" and make if work correctly with further sorting.
Metadata
Metadata
Assignees
Labels
No labels