Skip to content

Commit 3dc0e49

Browse files
authored
Merge pull request #9633 from marmelab/feat/add-screenshots-to-EditableDatagrid-doc
[Doc] Add screencasts and screenshot to EditableDatagrid OSS doc
2 parents a68a51c + 31cd76f commit 3dc0e49

6 files changed

+26
-1
lines changed

docs/EditableDatagrid.md

+26-1
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,20 @@ const RowAction = () => (
124124
);
125125
```
126126

127+
<video controls autoplay playsinline muted loop>
128+
<source src="./img/editableDatagrid-actions.webm" type="video/webm"/>
129+
<source src="./img/editableDatagrid-actions.mp4" type="video/mp4"/>
130+
Your browser does not support the video tag.
131+
</video>
132+
127133
## `createForm`
128134

129135
The component displayed as the first row when a user clicks on the Create button. It's usually a form built with [`<RowForm>`](#rowform), with the same number of children as the `<EditableDatagrid>` has children.
130136

131137
```tsx
132138
export const ArtistList = () => (
133139
<List hasCreate empty={false}>
134-
<EditableDatagrid
140+
<EditableDatagrid
135141
editForm={<ArtistForm />}
136142
createForm={<ArtistForm />}
137143
>
@@ -205,6 +211,12 @@ Use the `mutationMode` prop to specify the [mutation mode](./Edit.html#mutationm
205211
</EditableDatagrid>
206212
```
207213

214+
<video controls autoplay playsinline muted loop>
215+
<source src="./img/editableDatagrid-mutationMode.webm" type="video/webm"/>
216+
<source src="./img/editableDatagrid-mutationMode.mp4" type="video/mp4"/>
217+
Your browser does not support the video tag.
218+
</video>
219+
208220
## `noDelete`
209221

210222
You can disable the delete button by setting the `noDelete` prop to `true`:
@@ -214,6 +226,7 @@ You can disable the delete button by setting the `noDelete` prop to `true`:
214226
{/*...*/}
215227
</EditableDatagrid>
216228
```
229+
![EditableDatagrid noDelete](./img/editableDatagrid-noDelete.png)
217230

218231
## `<RowForm>`
219232

@@ -319,6 +332,12 @@ Feel free to visit the [dedicated stories](https://react-admin.github.io/ra-ente
319332

320333
## Using Inside a `<ReferenceManyField>`
321334

335+
<video controls autoplay playsinline muted loop>
336+
<source src="./img/editableDatagrid-referenceManyField.webm" type="video/webm"/>
337+
<source src="./img/editableDatagrid-referenceManyField.mp4" type="video/mp4"/>
338+
Your browser does not support the video tag.
339+
</video>
340+
322341
You can use `<EditableDatagrid>` inside a `<ReferenceManyField>`. The only difference with its usage in a `<List>` is that you have to initialize the foreign key in the creation form using the `defaultValues` prop:
323342

324343
{% raw %}
@@ -384,6 +403,12 @@ In these examples, the same form component is used in `createForm` and `editForm
384403

385404
## Providing Custom Side Effects
386405

406+
<video controls autoplay playsinline muted loop>
407+
<source src="./img/editableDatagrid-custom_side_effect.webm" type="video/webm"/>
408+
<source src="./img/editableDatagrid-custom_side_effect.mp4" type="video/mp4"/>
409+
Your browser does not support the video tag.
410+
</video>
411+
387412
You can provide your own side effects in response to successful or failed save and delete actions, by passing functions to the `onSuccess` or `onError` inside the `mutationOptions` prop:
388413

389414
{% raw %}

docs/img/editableDatagrid-actions.mp4

3.31 MB
Binary file not shown.
Binary file not shown.
844 KB
Binary file not shown.
50.3 KB
Loading
7.15 MB
Binary file not shown.

0 commit comments

Comments
 (0)