admin-on-rest上ShowButton的自定义URL

时间:2018-02-05 15:41:36

标签: admin-on-rest

是否有办法为某些Show按钮创建自定义路径?

我有一个~/mylib下面有两种类型的组件,我想重定向到每个组件的显示页面。

src/helpers.h我有

ReferecenManyField

...我的CollectionShow可以是另一个Collection或LearningObject。

有没有办法为<Show title={<CollectionTitle />} actions={<CollectionShowActions />} {...props}> <SimpleShowLayout> ... <ReferenceManyField label="Itens" target="collection_id" reference="collection_items"> <Datagrid bodyOptions={{ showRowHover: true }}> <TextField source="id" /> <TextField label="Tipo" source="collectionable_type" /> <TextField label="Nome" source="collectionable.name" sortable={false} /> <TextField label="Privacidade" source="collectionable.privacy" sortable={false} /> <ShowButton /> </Datagrid> </ReferenceManyField> 制作可定制的网址?

可能是这样的:

collectionable_type

1 个答案:

答案 0 :(得分:1)

<ShowButton />组件专门用于创建由admin-on-rest管理的节目视图的链接。

要在Datagrid中制作可定制的网址,您应该按照文档Writing Your Own Field Component

中的说明创建专用的field component
相关问题