dataKey should allow for nested properties...
See original GitHub issueWe have a scenario where our row data is an object with nested properties, like so:
{
"name": 'bob',
"metaData": {
"foo": 'x',
"bar": {
// ... more data ...
},
"baz": {
"blah": false
}
}
}
In my table I want to display columns of information for all the data in my object, not just the top-level… also, because dataKey is used to uniquely identify a column to an object property, and because it does not allow nesting, I have to flatten my object and assign a different dataKey for every column…
It would be helpful if instead, I could provide a nested dataKey value and have react-virtualized
parse my object accordingly…
Example:
<Column dataKey='name' ... />
<Column dataKey='metaData.foo' ... />
<Column dataKey='metaData.bar' ... />
<Column dataKey='metaData.baz.blah' ... />
Issue Analytics
- State:
- Created 5 years ago
- Reactions:19
- Comments:5
Top Results From Across the Web
javascript - Mapping through array in React with nested objects
I want to have the _value for each object so that I can eventually load it into a area chart from rechart. The...
Read more >how to use multiple Datakeys in Nested Gridview?? - MSDN
I think you can do like this: 1) Put a gridview into the outer GridView. In its Itemteplate put another Gridview with a...
Read more >Exploring Recharts: different ways of accessing data
Passing data in dataKey helps with some level of customization to allow accessing data or nested data directly using object keys.
Read more >Nested JSON to Table - Queries and Resources - Retool Forum
When I try it comes through as a table with names as the columns and one row of nested objects for each name....
Read more >Data Keys - Ignition User Manual 7.9
Dynamic Data Keys allow you to use the value of a Data Key on a non-string property. With Dynamic Data Keys, you can...
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 FreeTop 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
Top GitHub Comments
Another option can be:
<Column label="Eye color" dataKey="someid" cellDataGetter={({rowData})=>rowData.nested.eyeColor} />
@AlexAichinger What we ended up doing is passing in a dataKey that does not map to anything specific, but is unique, and then using a switch statement in our renderer with the dataKey to determine which rowData property value to use… its not great, but it works…