diff --git a/docs/List.md b/docs/List.md index a404d5252ae..1611a78fbbe 100644 --- a/docs/List.md +++ b/docs/List.md @@ -812,7 +812,7 @@ You can change the filters by updating the query parameter, e.g. using the ` { const translate = useTranslate(); @@ -831,13 +830,7 @@ const LinkToRelatedProducts = ({ record }) => { component={Link} to={{ pathname: '/posts', - search: stringify({ - page: 1, - perPage: 25, - sort: 'id', - order: 'DESC', - filter: JSON.stringify({ category_id: record.id }), - }), + search: `filter=${JSON.stringify({ category_id: record.id })}`, }} > All posts with the category {record.name} ; @@ -849,8 +842,6 @@ const LinkToRelatedProducts = ({ record }) => { You can use this button e.g. as a child of ``. You can also create a custom Menu button with that technique to link to the unfiltered list by setting the filter value to `{}`. -**Tip**: You have to pass *all* the query string parameters - not just `filter`. That's a current limitation of react-admin. - ### The `` Button/Form Combo ![List Filters](./img/list_filter.gif) diff --git a/examples/demo/src/categories/LinkToRelatedProducts.tsx b/examples/demo/src/categories/LinkToRelatedProducts.tsx index 0570e05309a..cf22713b630 100644 --- a/examples/demo/src/categories/LinkToRelatedProducts.tsx +++ b/examples/demo/src/categories/LinkToRelatedProducts.tsx @@ -28,10 +28,6 @@ const LinkToRelatedProducts: FC> = ({ record }) => { to={{ pathname: '/products', search: stringify({ - page: 1, - perPage: 20, - sort: 'reference', - order: 'ASC', filter: JSON.stringify({ category_id: record.id }), }), }} diff --git a/examples/demo/src/segments/LinkToRelatedCustomers.tsx b/examples/demo/src/segments/LinkToRelatedCustomers.tsx index afb72f37eab..aae6233e462 100644 --- a/examples/demo/src/segments/LinkToRelatedCustomers.tsx +++ b/examples/demo/src/segments/LinkToRelatedCustomers.tsx @@ -27,8 +27,6 @@ const LinkToRelatedCustomers: FC<{ segment: string }> = ({ segment }) => { to={{ pathname: '/customers', search: stringify({ - page: 1, - perPage: 25, filter: JSON.stringify({ groups: segment }), }), }}