Server-Side Usage Example

When returning a collection from a Jade REST API, it is automatically paginated according to the request from the client. You do not need to make any changes to your Jade code to enable this pagination functionality.

If you want to use the envelope‑based pagination style, you can use the JadePaginationEnvelope class loadCollection method to load the collection into the JadePaginationEnvelope object, then return that object from your REST API method; for example:

getCustomers(): JadePaginationEnvelope;
vars
    customers : CustomerDict;
    envelope : JadePaginationEnvelope;
begin
    customers := app.myCustomers;
    create envelope transient;
    envelope.loadCollection(customers, self);
    return envelope;
end;

2022.0.01 and higher