You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your `authProvider` implements [Access Control](./Permissions.md#access-control), `<DeleteButton>` will only render if the user has the "delete" access to the related resource.
118
+
119
+
`<DeleteButton>` will call `authProvider.canAccess()` using the following parameters:
Should you need to only archive records, the soft delete feature from the [Enterprise Edition add-on](https://react-admin-ee.marmelab.com/documentation/ra-soft-delete) provides the [`<BulkSoftDeleteButton />`](./BulkSoftDeleteButton.md), a drop-in replacement for `<BulkDeleteButton>`.
128
+
115
129
## `<BulkExportButton>`
116
130
117
131
Same as `<ExportButton>`, except it only exports the selected rows instead of the entire list. To be used inside [the `<DataTable bulkActionButtons>` prop](./DataTable.md#bulkactionbuttons).
@@ -1022,6 +1036,10 @@ If your `authProvider` implements [Access Control](./Permissions.md#access-contr
Should you need to only archive records, the soft delete feature from the [Enterprise Edition add-on](https://react-admin-ee.marmelab.com/documentation/ra-soft-delete) provides the [`<SoftDeleteButton />`](./SoftDeleteButton.md), a drop-in replacement for `<DeleteButton>`.
1042
+
1025
1043
## `<DeleteWithConfirmButton>`
1026
1044
1027
1045
Delete the current record after a confirm dialog has been accepted. To be used inside a `<Toolbar/>` component.
@@ -1063,15 +1081,15 @@ const MyEdit = () => (
1063
1081
<Edit>
1064
1082
<SimpleForm toolbar={<EditToolbar />}>
1065
1083
...
1066
-
</SimpleForm>
1067
-
</Edit>
1084
+
</SimpleForm>
1085
+
</Edit>
1068
1086
);
1069
1087
```
1070
1088
{% endraw %}
1071
1089
1072
1090
## `<EditButton>`
1073
1091
1074
-
Opens the Edit view of the current record.
1092
+
Opens the Edit view of the current record.
1075
1093
1076
1094

1077
1095
@@ -1397,7 +1415,7 @@ By default, react-admin's `<DataTable>` displays a `<SelectAllButton>` in its `b
The mutation mode determines when the side effects (redirection, notifications, etc.) are executed:
1638
1656
1639
-
-`pessimistic`: The mutation is passed to the dataProvider first. When the dataProvider returns successfully, the mutation is applied locally, and the side effects are executed.
1640
-
-`optimistic`: The mutation is applied locally and the side effects are executed immediately. Then the mutation is passed to the dataProvider. If the dataProvider returns successfully, nothing happens (as the mutation was already applied locally). If the dataProvider returns in error, the page is refreshed and an error notification is shown.
1657
+
-`pessimistic`: The mutation is passed to the dataProvider first. When the dataProvider returns successfully, the mutation is applied locally, and the side effects are executed.
1658
+
-`optimistic`: The mutation is applied locally and the side effects are executed immediately. Then the mutation is passed to the dataProvider. If the dataProvider returns successfully, nothing happens (as the mutation was already applied locally). If the dataProvider returns in error, the page is refreshed and an error notification is shown.
1641
1659
-`undoable` (default): The mutation is applied locally and the side effects are executed immediately. Then a notification is shown with an undo button. If the user clicks on undo, the mutation is never sent to the dataProvider, and the page is refreshed. Otherwise, after a 5 seconds delay, the mutation is passed to the dataProvider. If the dataProvider returns successfully, nothing happens (as the mutation was already applied locally). If the dataProvider returns in error, the page is refreshed and an error notification is shown.
1642
1660
1643
-
By default, the `<UpdateButton>` uses the `undoable` mutation mode. This is part of the "optimistic rendering" strategy of react-admin ; it makes user interactions more reactive.
1661
+
By default, the `<UpdateButton>` uses the `undoable` mutation mode. This is part of the "optimistic rendering" strategy of react-admin ; it makes user interactions more reactive.
1644
1662
1645
1663
You can change this default by setting the `mutationMode` prop. For instance, to remove the ability to undo the changes, use the `optimistic` mode:
**Tip**: When using any other mode than `undoable`, the `<UpdateButton>` displays a confirmation dialog before calling the dataProvider.
1692
+
**Tip**: When using any other mode than `undoable`, the `<UpdateButton>` displays a confirmation dialog before calling the dataProvider.
1675
1693
1676
1694
### `confirmTitle`
1677
1695
@@ -1777,7 +1795,7 @@ The default `onSuccess` function is:
1777
1795
}
1778
1796
```
1779
1797
1780
-
**Tip**: When you use `mutationMode="pessimistic"`, the `onSuccess` function receives the response from the `dataProvider.update()` call, which is the edited record (see [the dataProvider documentation for details](./DataProviderWriting.md#update)). You can use that response in the success side effects:
1798
+
**Tip**: When you use `mutationMode="pessimistic"`, the `onSuccess` function receives the response from the `dataProvider.update()` call, which is the edited record (see [the dataProvider documentation for details](./DataProviderWriting.md#update)). You can use that response in the success side effects:
0 commit comments