【发布时间】:2020-05-12 12:11:31
【问题描述】:
当我编辑一个项目时,我想获得之前选中的引用选项。选项显示得很好,但始终未选中。不过,它会保存我所做的任何更改。
它与 CheckboxGroupInput 以及 AutocompleteArrayInput 的工作方式相同。
ReferenceArrayInput 正在将此数组数据发送到 CheckboxGroupInput:
0: {id: 1, company-name: "Empresa 1", created_at: "2019-08-09T18:08:18.066Z", updated_at: "2019-08-28T13:17:02.474Z", …}
1: {id: 3, company-name: "Empresa 3", created_at: "2019-08-23T12:41:15.254Z", updated_at: "2019-08-23T12:41:15.528Z", …}
2: {id: 5, company-name: "Empresa 5", created_at: "2019-08-23T12:41:31.762Z", updated_at: "2019-08-23T12:41:32.013Z", …}
这是代码:
<SimpleForm>
<TextInput source="game-name" label="Name" />
<ReferenceArrayInput
source="companies"
reference="companies">
<CheckboxGroupInput translateChoice={false} optionText="company-name"/>
</ReferenceArrayInput>
</SimpleForm>
现在我收到了这条消息:“至少有一个关联的引用似乎不再可用。”表格下方。控制台没有显示任何错误。
【问题讨论】:
标签: react-admin