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
|`source`| Required |`string`| - | Name of the entity property to use for the input value |
33
-
|`label`| Optional |`string`| - | Useful only when `ReferenceInput` is in a Filter array, the label is used as the Filter label.|
34
-
|`reference`| Required |`string`| '' | Name of the reference resource, e.g. 'posts'. |
35
-
|`children`| Optional |`ReactNode`|`<AutocompleteInput />`| The actual selection component |
36
-
|`filter`| Optional |`Object`|`{}`| Permanent filters to use for getting the suggestion list |
37
-
|`page`| Optional |`number`| 1 | The current page number |
38
-
|`perPage`| Optional |`number`| 25 | Number of suggestions to show |
39
-
|`sort`| Optional |`{ field: String, order: 'ASC' or 'DESC' }`|`{ field: 'id', order: 'DESC' }`| How to order the list of suggestions |
40
-
|`enableGetChoices`| Optional |`({q: string}) => boolean`|`() => true`| Function taking the `filterValues` and returning a boolean to enable the `getList` call. |
|`source`| Required |`string`| - | Name of the entity property to use for the input value |
33
+
|`label`| Optional |`string`| - | Useful only when `ReferenceInput` is in a Filter array, the label is used as the Filter label. |
34
+
|`reference`| Required |`string`| '' | Name of the reference resource, e.g. 'posts'. |
35
+
|`children`| Optional |`ReactNode`|`<AutocompleteInput />`| The actual selection component |
36
+
|`filter`| Optional |`Object`|`{}`| Permanent filters to use for getting the suggestion list |
37
+
|`page`| Optional |`number`| 1 | The current page number |
38
+
|`perPage`| Optional |`number`| 25 | Number of suggestions to show |
39
+
|`sort`| Optional |`{ field: String, order: 'ASC' or 'DESC' }`|`{ field: 'id', order: 'DESC' }`| How to order the list of suggestions |
40
+
|`enableGetChoices`| Optional |`({q: string}) => boolean`|`() => true`| Function taking the `filterValues` and returning a boolean to enable the `getList` call. |
**Note**: `<ReferenceInput>` doesn't accept the [common input props](./Inputs.md#common-input-props) (like `label`) ; it is the responsibility of the child component to apply them.
43
44
@@ -79,7 +80,8 @@ You can make the `getList()` call lazy by using the `enableGetChoices` prop. Thi
79
80
<ReferenceInput
80
81
source="post_id"
81
82
reference="posts"
82
-
enableGetChoices={({ q }) =>q.length>=2} />
83
+
enableGetChoices={({ q }) =>q.length>=2}
84
+
/>
83
85
```
84
86
85
87
## `filter`
@@ -166,6 +168,22 @@ Then to display a selector for the post author, you should call `<ReferenceInput
Why does `<ReferenceInput>` use the `dataProvider.getMany()` method with a single value `[id]` instead of `dataProvider.getOne()` to fetch the record for the current value?
0 commit comments