Reactjs rest引用输入上的管理用于编辑,但不用于创建
出于某种原因,ReferenceInput在我的编辑表单上运行良好;但在createform上,它显示为disabled和empty(我对这两个表单使用相同的代码)。它也没有显示chrome开发工具中的任何错误。我是否需要为创建表单做其他工作?谢谢这对我有用。请注意参考输入中的“allowEmpty”Reactjs rest引用输入上的管理用于编辑,但不用于创建,reactjs,admin-on-rest,Reactjs,Admin On Rest,出于某种原因,ReferenceInput在我的编辑表单上运行良好;但在createform上,它显示为disabled和empty(我对这两个表单使用相同的代码)。它也没有显示chrome开发工具中的任何错误。我是否需要为创建表单做其他工作?谢谢这对我有用。请注意参考输入中的“allowEmpty” <Create title="My title" {...props}> <SimpleForm> <TextInput label= "fi
<Create title="My title" {...props}>
<SimpleForm>
<TextInput label= "field 1" source="f1" validate={[ required, minLength(3), maxLength(20) ]} />
<ReferenceInput label="field 2" source="f2" validate={[ required ]} reference="reference1" allowEmpty>
<AutocompleteInput optionText="f3" />
</ReferenceInput>
</SimpleForm>
</Create>
请共享您的代码您可能需要在中设置allowEmpty on referenceInputcreate@kunalpareek啊哈,那是真的,我想要么这样,要么设置默认值。应该在文件中提到。谢谢:)