Open wpeterw opened 9 months ago
You mean in a table?
I think that's not yet supported.
yes, in a table, my data has nested objects.
I think we could support that by using something like lodash.get
(https://lodash.com/docs/4.17.15#get) in the frontend.
This way the backend can define any nested path to the data in the backend (e.g. teams.name
or even array indexing like teams[0].names[1]
) and the frontend tries to get the given path from the object.
Not sure if performance might be an issue here as we would do this for every cell. Though, I would assume that lodash
's implementation is already quite optimized.
Would be happy to contribute a PR for this if you agree
One work-around could be to create a custom TeamRow model with non-nested fields that you want to display.
@hillstub Could you maybe provide a sample code? I am currently facing the same problem.
I have a model like this (code below), how do I access for instance the name in TeamModel ?
This does not work: