display array with arrayField or other
See original GitHub issueHello,
I want to display a list of items that are stored in a array ([1,3,4,5,7…])
With ArrayField I can’t display the elements as I want because it expects an object array when I have a simple array.
How to display the elements stored in a array ?
Currently I am creating my own field for this :
const TagsFieldInstitutes = ({ record }) => (
<div>
{record.institutes.map(item => (
<span key={item} className="chip">
{item}
</span>
))}
</div>
);
But I think there is a better way. Thanks you for your help !
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:19 (10 by maintainers)
Top Results From Across the Web
How to display Django array data - Stack Overflow
How to display Django array data ... I have inserted some data into the models array field. ... I want to view my...
Read more >Is it possible to display the ArrayField as a list of elements ...
My model contains a field like this: from django.contrib.postgres.fields import ArrayField text_list = ArrayField(models.
Read more >How to display a table refering to an array field from ... - Wix.com
I have a collection of data with an array field. I'm trying to display the content from the array field in a table...
Read more >The ArrayField Component - React-admin - Marmelab
Display a collection using <Field> child components. Ideal for embedded arrays of objects, e.g. tags and backlinks in the following post object: { ......
Read more >Display array fields - IBM
You can expand such a field to display the values in the array, ... In an unexpanded array field or in an array...
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
I cannot comprehend why this has been essentially wontfixed. There is nothing at all strange about an API returning an array of strings like
['a', 'b', 'c']
. And it’s ridiculous to expect the API to be rewritten to return[{label: 'a'}, {label: 'b'}, {label: 'c'}]
. That changes the API response that other clients uses from a sensible response to a nonsensical one.@afilp as explained in the documentation:
We won’t add a new field to replace a one liner in userland.