I have a CheckboxGroupInput
field like this:
<CheckboxGroupInput source="fruits" choices={[
{ 'name': 'apples' },
{ 'name': 'pears' }
]} optionValue='name'/>
which produces json likes this for the fruits
field when the user selects both options:
'fruits': ['apples','pears']
I want to display it in a List
using ChipField
which requires a source
which I don't have, because the json is a plain string array.
source would be "name" if json looked like fruits:[{'name':'apples'}, {'name':'pears'}]
<ArrayField source='fruits'>
<SingleFieldList>
<ChipField source='???' />
</SingleFieldList>
</ArrayField>
How can I show the contents of a plain string array with ChipField
OR how do I tell CheckboxGroupInput
to produce an object array instead of a string array?