2

I need to render a <ReferenceManyField />.

By default, it use a perPage of 25 limitation that can be increased.

Is there a way to turn off this limitation eg: perPage={false} ?

Dimitri Kopriwa
  • 13,139
  • 27
  • 98
  • 204

3 Answers3

2

actually it depends both on your backend setup and restClient you use...

see restClient example : https://github.com/marmelab/admin-on-rest/blob/49a616c93d1ee5ea0bfa3c5f7abea0bb29c8d01c/src/rest/simple.js (convertRESTRequestToHTTP)

it is possible to override pagination query like :

const { page, perPage } = params.pagination;
const { field, order } = params.sort;

let query = {
    sort: JSON.stringify([field, order]),
    filter: JSON.stringify(params.filter),
};
if (perPage > 0) {
    query.range = JSON.stringify([
           (page - 1) * perPage,
           page * perPage - 1,
    ]);
}

(of course paging query params depends on your backend, it is just a sample )

3176243
  • 561
  • 4
  • 7
1

No, there is not. However, you may just pass a very large value or maybe -1. It's then up to your backend to handle it correctly

Gildas Garcia
  • 6,966
  • 3
  • 15
  • 29
-1

I used perPage={-1} for ReferenceInput and it worked for me.

Miguel Araya
  • 404
  • 3
  • 10