In admin ListView and EditView provide more data for Relationship field. #11874
Closed
jure123
started this conversation in
Feature Requests & Ideas
Replies: 1 comment
-
UPDATE: I figured out how to configure custom depth for fetched document in ListView or EditView. You can define
After this change I could read document.articles[0].title in my custom RowLabel component. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We have an array field with relationship field to article collection. By defining useAsTitle property in the articles collection, article titles show correctly in the relationship dropdown. But we also want the article titles to show in the array row labels, like so:
We have tried to make a custom RowLabel component for the array field. The component receives RowFieldServerProps with document data, but docData.articles[] only contains article IDs. Is it possible to get article titles (and also other article data), without having to make additional fetches for each array item (what would not be very perfromant)?
I guess it would be useful if the Relationship field config would have a new property like admin.depth, so we could define how much depth we want to receive in document data for ListView or EditView. If this is not possible to setup for each relation field then maybe at least you can support admin.depth property on the collection level (so when payload.find() fetches the collection items you can just pass the admin.depth param to the find() function). This way we'd have more flexibility to show some additional detailed data for the linked collections in ListView or EditView.
Beta Was this translation helpful? Give feedback.
All reactions