diff --git a/docs/Fields.md b/docs/Fields.md index 54669708a75..4960f72673d 100644 --- a/docs/Fields.md +++ b/docs/Fields.md @@ -988,7 +988,7 @@ Also, you can filter the query used to populate the possible values. Use the `fi This [Enterprise Edition](https://marmelab.com/ra-enterprise) component fetches a list of referenced records by lookup in an associative table, and passes the records down to its child component, which must be an iterator component. -For instance, here is how to fetch the authors related to a book record by matching book.id to book_authors.post_id, then matching book_authors.author_id to authors.id, and then display the author last_name for each, in a : +For instance, here is how to fetch the authors related to a book record by matching book.id to book_authors.post_id, then matching book_authors.author_id to authors.id, and then display the author last_name for each, in a ``: ```jsx import * as React from 'react'; diff --git a/docs/Inputs.md b/docs/Inputs.md index 4881cfaa485..e129820f256 100644 --- a/docs/Inputs.md +++ b/docs/Inputs.md @@ -1939,27 +1939,30 @@ You can tweak how this component fetches the possible values using the `perPage` // by default, fetches only the first 25 values. You can extend this limit // by setting the `perPage` prop. + source="tag_ids" + reference="tags" + perPage={100} +> // by default, orders the possible values by id desc. You can change this order // by setting the `sort` prop (an object with `field` and `order` properties). + source="tag_ids" + reference="tags" + sort={{ field: 'title', order: 'ASC' }} +> // you can filter the query used to populate the possible values. Use the // `filter` prop for that. + source="tag_ids" + reference="tags" + filter={{ is_published: true }} +> ``` @@ -2061,27 +2064,30 @@ You can tweak how this component fetches the possible values using the `perPage` // by default, fetches only the first 25 values. You can extend this limit // by setting the `perPage` prop. + source="post_id" + reference="posts" + perPage={100} +> // by default, orders the possible values by id desc. You can change this order // by setting the `sort` prop (an object with `field` and `order` properties). + source="post_id" + reference="posts" + sort={{ field: 'title', order: 'ASC' }} +> // you can filter the query used to populate the possible values. Use the // `filter` prop for that. + source="post_id" + reference="posts" + filter={{ is_published: true }} +> ``` @@ -2092,9 +2098,10 @@ The child component may further filter results (that's the case, for instance, f ```jsx ({ title: searchText })}> + source="post_id" + reference="posts" + filterToQuery={searchText => ({ title: searchText })} +> ```