Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. const Example = ({ record, ...props }) => {
  2. console.log('props=',props)
  3. console.log('Record=', record)
  4. return <TextField
  5. {...props}
  6. record={record}
  7. label="robot.form.name"
  8. source="name"
  9. />
  10. }
  11.  
  12. const RobotShow = (props) => (
  13. <Show title={<RobotTitle />} {...props}>
  14. <TabbedShowLayout>
  15. <Tab label="robot.form.main">
  16. <TextField
  17. label="robot.form.name"
  18. source="name"
  19. />
  20. <DateField
  21. label="robot.form.crateDate"
  22. source="createDate"
  23. />
  24. <ReferenceField
  25. reference="parser-configs"
  26. label="robot.form.parserConfig"
  27. source="parserConfigId"
  28. allowEmpty={true}
  29. >
  30. <TextField source="name" />
  31. </ReferenceField>
  32. <SelectField
  33. label="robot.form.type"
  34. source="config.type"
  35. choices={robotsModeChoices()}
  36. />
  37. </Tab>
  38. <Tab label="robot.form.main">
  39. <Example />
  40. </Tab>
  41. </TabbedShowLayout>
  42. </Show>
  43. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement