Добавление списка в поле <SelectInput> - PullRequest
0 голосов
/ 07 мая 2019

Мне нужно добавить выпадающий список под целью, я добавил под выбором внутри поля 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>
...