Reputation: 1032
I would like to have Datagrid with Delete
button as below (picture is copied from stackoverflow.com):
I read react-admin documents but did not find any hints to add a Delete
button onto the row.
Any body know how to?
Thanks,
Upvotes: 3
Views: 3487
Reputation: 390
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>
);
Upvotes: 8