Paging

Telerik Platform can return query results in pages to save you bandwidth and additional operations on the client. A page is defined by a starting item (the one immediately preceding the first item on the page) specified using the skip method and the number of items it contains (the take method).

Note

Paging is supported for READ and DELETE operations only.

The following example instructs the server to skip three (skip(3)) items and return the next ten (take(10)) items. This means that it will return items 4 to 13 (if the first element is indexed 1). Most of the time, you will want the items sorted in a particular order before reading them in pages, which is why the example adds sorting by the Author field. Sorting is always executed before paging.

var el = new Everlive('your-app-id');
var data = el.data('Books');

var query = new Everlive.Query();
query.order('Author');
query.skip(3).take(10);

data.get(query) // filter
    .then(function(data){
        alert(JSON.stringify(data));
    },
    function(error){
        alert(JSON.stringify(error));
    });

The delete operation also supports deleting by pages. You can apply sorting just like with reading.

See Also

Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.