pagingSize

pagingSize: undefined | number

Paging size for obtaining nodes.

Presentation data providers, when used with paging, have ability to save one backend request for size / count. That can only be achieved when pagingSize property is set on the data provider and it's value matches size which is used when requesting nodes. To help developers notice this problem, data provider emits a warning similar to this:

PresentationTreeDataProvider.pagingSize doesn't match pageOptions in PresentationTreeDataProvider.getNodes call. Make sure you set PresentationTreeDataProvider.pagingSize to avoid excessive backend requests.

To fix the issue, developers should make sure the page size used for requesting data is also set for the data provider:

const pagingSize = 10;
const provider = new TreeDataProvider({imodel, ruleset, pagingSize});
// only one backend request is made for the two following requests:
provider.getNodesCount();
provider.getNodes({ start: 0, size: pagingSize });

Defined in

Last Updated: 20 June, 2023