在<selectinput>字段下添加列表

时间:2019-05-07 12:37:14

标签: react-admin

我需要在此目的下添加一个下拉列表,我已经在selectInput字段内的选项下添加了。 该列表正在显示,但是当我单击“保存”按钮时,其显示目的必须是字符串。

            <SimpleForm>
                <SelectInput label="Purpose" source="purpose" choices={[
                    { id: 1, name: "Diagnosis" },
                    { id: 2, name: "Surgery" },
                    { id: 3, name: "Chemotherapy" },
                    { id: 4, name: 'Concurrent (Chemo+Radiation)' },
                    { id: 5, name: 'Concurrent Followup(Chemo+Radiation)'},
                    { id: 6, name: 'Palliative Treatment' },
                    { id: 7, name: 'Post-Chemotherapy Follow up' },
                    { id: 8, name: 'Post-Radiation Follow up' },
                    { id: 9, name: 'Post-Surgery Follow up' },
                    { id: 10, name: 'Radiation' },
                    { id: 11, name: 'Side effect/ Supportive Care' }
                ]} />
                <SelectInput label="Hospitals" source="hospital_id" choices={hospitalsArr} required />
                <SelectInput label="Patients" source="patient_id" choices={patientsArr} required />
                <DateInput source="appointment_date" onChange={this.handleOnchange} />
                <SelectInput label="Slots" source="appointment_id" choices={slotsInputArr} required />
            </SimpleForm>
        </Create>

0 个答案:

没有答案