2017-08-18 3 views
0

編集ページで次のように表示したいと思います。区間の部分を保持するためにサブデータグリッドを作成するのに問題があります。Admin-On-Rest:編集ビューでJsonグリッドを表示

[ 
{ 
    "name": "Jenn", 
    "description": "", 
    "duration": 780, 
    "level": 2, 
    "instructor": 1, 
    "category": 1, 
    "equipment": [ 
     1, 
     2 
    ], 
    "intervals": [ 
     { 
      "interval": 11, 
      "time": 30, 
      "Incline": 30 
     }, 
     { 
      "interval": 34, 
      "time": 30, 
      "Incline": 0 
     } 
    ], 
    "id": 1, 
    "createdAt": "2017-08-18T13:56:50.000Z", 
    "updatedAt": "2017-08-18T13:56:50.000Z" 
} 

]これは私が現在持っているものである

:私は何とかデータグリッドにサブレコードを渡す必要が推測している

export const ClassEdit = (props) => (
    <Edit title={<ClassTitle />} {...props}> 
     <SimpleForm> 
      <DisabledInput source="id" /> 
      {/*<ReferenceInput label="instructor" source="instructor.id" reference="instructor">*/} 
      {/*<SelectInput optionText="name" />*/} 
      {/*</ReferenceInput>*/} 
      <TextInput source="name" /> 
      <LongTextInput source="description" /> 
      <NumberInput source="duration" /> 
      <NumberInput source="level" /> 
      <NumberInput source="instructor" /> 
      <SelectInput source="category" choices={categoryList} /> 
      <SelectArrayInput label="Equipment" source="equipment" choices={equipmentList}/> 
      <Datagrid > 
       <NumberField source="intervals.interval"/> 
      </Datagrid> 
     </SimpleForm> 

    </Edit> 

、それを行う方法がわかりませんか?

答えて

関連する問題