React-admin | How to concat source inside ReferenceField

有些话、适合烂在心里 提交于 2020-01-15 09:39:47

问题


I have a table "fos_user" and "version", I would like to display "9.0.1.A" instead of "/ version / 1".

=>fos_user https://i.imgur.com/C8f0qor.png

=>version https://i.imgur.com/HFSKIdz.png

Is it possible to concatenate the fields of the "version" table to display it in the source, like this? https://i.imgur.com/rxJBmtp.png

Because it will prevent me from creating a new field in the "version" table.

Best regards,


回答1:


React-admin | How to concat source inside ReferenceField ?

Answer:

<ReferenceField label="Version" source="version" reference="versions"> <FunctionField render={version => `${version.major}.${version.minor}.${version.patch}.${version.letter}`} /> </ReferenceField>



来源:https://stackoverflow.com/questions/51418951/react-admin-how-to-concat-source-inside-referencefield

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!