docs: add type specification of relation widget valueField (#2446)

This commit is contained in:
shumiyao 2019-11-07 21:25:21 +00:00 committed by Shawn Erquhart
parent c643266b53
commit 47be26fbfe

View File

@ -13,7 +13,7 @@ The relation widget allows you to reference items from another collection. It pr
- `collection`: (**required**) name of the collection being referenced (string)
- `displayFields`: list of one or more names of fields in the referenced collection that will render in the autocomplete menu of the control. Defaults to `valueField`. For nested fields, separate each subfield with a `.` (E.g. `name.first`).
- `searchFields`: (**required**) list of one or more names of fields in the referenced collection to search for the typed value. Syntax to reference nested fields is similar to that of *displayFields*.
- `valueField`: (**required**) name of the field from the referenced collection whose value will be stored for the relation. Syntax to reference nested fields is similar to that of *displayFields* and *searchFields*.
- `valueField`: (**required**) name of the field from the referenced collection whose value will be stored for the relation. Syntax to reference nested fields is similar to that of *displayFields* and *searchFields*. As `valueField` only allows for a single field, this parameter only accepts a string.
- `multiple` : accepts a boolean, defaults to `false`
- `optionsLength`: accepts integer to override number of options presented to user. Defaults to `20`.
- **Example** (assuming a separate "authors" collection with "name" and "twitterHandle" fields with subfields "first" and "last" for the "name" field):