Paging a query across Task runs: what each page asks for, and whether another page follows.
A paged load runs every page on a NEW Task node (see replaceTask in tasks.bs), so the node cannot be the memory of the query: each page must ask for exactly what the first page asked for. The screen holds the query as a plain AA and hands each run a copy with that page's startIndex. BaseGridView and the TV guide (Schedule) both page this way.
- Source
Methods
(static) forPage(query, startIndex) → {object}
The fields for one run of query, starting at startIndex. A copy: query itself is left untouched, so it stays the record of what every page of the load asks for.
| Name | Type | Description |
|---|---|---|
query | object | the load's Task input fields, without startIndex |
startIndex | integer | the first item to fetch |
- Source
Task input fields for this page
- Type:
- object
(static) nextStart(startIndex, delivered, total) → {integer}
Where the next page starts, or -1 when the load is complete.
A page that delivers nothing ends the load even when total says more exist: the next request would ask for the same startIndex and get the same empty answer, forever.
| Name | Type | Description |
|---|---|---|
startIndex | integer | the startIndex of the page that was delivered |
delivered | integer | how many items that page delivered |
total | integer | the server's total for the query |
- Source
the next page's startIndex, or -1
- Type:
- integer