Skip to content

Commit 430d951

Browse files
committed
docs: address PR feedback on DataTableInput references
1 parent a6bc49b commit 430d951

5 files changed

Lines changed: 8 additions & 2 deletions

docs/Inputs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ React-admin provides a set of Input components, each one designed for a specific
7777
| Object | `{ foo: 'bar' }` | All inputs (see [ `source`](#source)) |
7878
| Enum | `'foo'` | [`<SelectInput>`](./SelectInput.md), [`<AutocompleteInput>`](./AutocompleteInput.md), [`<RadioButtonGroupInput>`](./RadioButtonGroupInput.md), [`<DataTableInput>`](./DataTableInput.md)<img class="icon" src="./img/premium.svg" alt="React Admin Enterprise Edition icon" /> |
7979
| Tree node | `42` | [`<TreeInput>`](./TreeInput.md) |
80-
| Foreign key | `42` | [`<ReferenceInput>`](./ReferenceInput.md), [`<DataTableInput>`](./DataTableInput.md)<img class="icon" src="./img/premium.svg" alt="React Admin Enterprise Edition icon" /> |
80+
| Foreign key | `42` | [`<ReferenceInput>`](./ReferenceInput.md) |
8181
| Array of objects | `[{ item: 'jeans', qty: 3 }, { item: 'shirt', qty: 1 }]` | [`<ArrayInput>`](./ArrayInput.md) |
8282
| Array of Enums | `['foo', 'bar']` | [`<TextArrayInput>`](./TextArrayInput.md), [`<SelectArrayInput>`](./SelectArrayInput.md), [`<AutocompleteArrayInput>`](./AutocompleteArrayInput.md), [`<CheckboxGroupInput>`](./CheckboxGroupInput.md), [`<DualListInput>`](./DualListInput.md) |
83-
| Array of foreign keys | `[42, 43]` | [`<ReferenceArrayInput>`](./ReferenceArrayInput.md), [`<DataTableInput>`](./DataTableInput.md)<img class="icon" src="./img/premium.svg" alt="React Admin Enterprise Edition icon" /> |
83+
| Array of foreign keys | `[42, 43]` | [`<ReferenceArrayInput>`](./ReferenceArrayInput.md) |
8484
| Translations | `{ en: 'Hello', fr: 'Bonjour' }` | [`<TranslatableInputs>`](./TranslatableInputs.md) |
8585
| Related records | `[{ id: 42, title: 'Hello' }, { id: 43, title: 'World' }]` | [`<ReferenceManyInput>`](./ReferenceManyInput.md), [`<ReferenceManyToManyInput>`](./ReferenceManyToManyInput.md), [`<ReferenceNodeInput>`](./ReferenceNodeInput.md), [`<ReferenceOneInput>`](./ReferenceOneInput.md) |
8686

docs/ReferenceArrayInput.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ import { ReferenceArrayInput, SelectInput } from 'react-admin';
145145
</ReferenceArrayInput>
146146
```
147147

148+
When your users need to compare several columns before selecting related records, you can use `<DataTableInput>` as child:
149+
148150
```jsx
149151
import { DataTableInput } from '@react-admin/ra-form-layout';
150152
import { DataTable, ReferenceArrayInput } from 'react-admin';
@@ -159,6 +161,8 @@ import { DataTable, ReferenceArrayInput } from 'react-admin';
159161
</ReferenceArrayInput>
160162
```
161163

164+
![DataTableInput in ReferenceArrayInput](./img/reference-array-input-datatable-input-dialog.png)
165+
162166
You can even use a component of your own as child, provided it detects a `ChoicesContext` is available and gets their choices from it.
163167

164168
The choices context value can be accessed with the [`useChoicesContext`](./useChoicesContext.md) hook.

docs/ReferenceInput.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ import { DataTable, ReferenceInput } from 'react-admin';
158158
</ReferenceInput>
159159
```
160160

161+
![DataTableInput in ReferenceInput](./img/reference-input-datatable-input-dialog.png)
162+
161163
You can even use a component of your own as child, provided it detects a `ChoicesContext` is available and gets their choices from it.
162164

163165
The choices context value can be accessed with the [`useChoicesContext`](./useChoicesContext.md) hook.
76.7 KB
Loading
75 KB
Loading

0 commit comments

Comments
 (0)