简体   繁体   中英

Pagination in share Point 2013 using rest API

I have one requirement to implement pagination in sharePoint 2013 using rest api.

I am currently using below query string for pagination:

var querystring="?$skiptoken=" + encodeURIComponent('Paged=TRUE&p_SortBehavior=0&p_ID=' + (startItemId-1) + '&$top=' + itemsCount);

It is working fine. But one of my client asking they want to display items and pagination based on order by start date.

I have tried with below querystring:

var querystring="?$skiptoken=" + encodeURIComponent('Paged=TRUE&p_SortBehavior=0&p_ID=' + (startItemId-1) + '&$top=' + itemsCount)+ "&$orderby=startdate ";

If I will give like this its not working. If i will give ID column instead of startdate its working fine.

Can any one suggest how to use startdate column in querystring while using skiptoken?

Thanks in advance

Modify your query like below. This should help.

var querystring="?$skiptoken=" + encodeURIComponent('Paged=TRUE&p_SortBehavior=0&p_ID=' + (startItemId-1) + '&$top=' + itemsCount + '&$orderby=startdate')

Thanks, Danny Please remember to mark as answer if it helps or vote if useful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM