Admin-On-Rest: Display Json grid in edit view -
i display following in edit page. i'm having trouble making sub-datagrid hold intervals part.
[ { "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" }
]
this have:
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>
i'm guessing have somehow pass sub records datagrid, not sure how that?
this not possible currently. however, working on pr that. see https://github.com/marmelab/admin-on-rest/pull/697
Comments
Post a Comment