[英]react-admin: How to show Delete button on each row in Datagrid
I would like to have Datagrid with Delete
button as below (picture is copied from stackoverflow.com): 我想使用带有Delete
按钮的Datagrid,如下所示(图片是从stackoverflow.com复制的):
I read react-admin documents but did not find any hints to add a Delete
button onto the row. 我阅读了react-admin文档,但没有发现任何将Delete
按钮添加到该行的提示。 Any body know how to? 有谁知道怎么做?
Thanks, 谢谢,
It is as simple as importing and adding the to your listview: 就像将导入并将其添加到列表视图一样简单:
import { Datagrid, TextField, EditButton, DeleteButton } from 'react-admin';
export const SaleList = props => (
<List {...props}>
<Datagrid>
<TextField source="id"/>
<EditButton/>
<DeleteButton/>
</Datagrid>
</List>
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.