【问题标题】:react-admin: How to show Delete button on each row in Datagridreact-admin:如何在 Datagrid 的每一行上显示删除按钮
【发布时间】:2019-07-05 12:19:23
【问题描述】:

我想有如下Delete按钮的Datagrid(图片从stackoverflow.com复制):

我阅读了 react-admin 文档,但没有找到任何将Delete 按钮添加到该行的提示。 有没有人知道怎么做?

谢谢,

【问题讨论】:

    标签: reactjs react-admin


    【解决方案1】:

    就像导入并添加到您的列表视图一样简单:

    import { Datagrid, TextField, EditButton, DeleteButton } from 'react-admin';
    export const SaleList = props => (
        <List {...props}>
            <Datagrid>
                <TextField source="id"/>
                <EditButton/>
                <DeleteButton/>
            </Datagrid>
        </List>
    );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-23
      • 1970-01-01
      • 2019-05-28
      • 1970-01-01
      • 2012-10-19
      相关资源
      最近更新 更多