简体   繁体   English

使用Rest API在Share Point 2013中进行分页

[英]Pagination in share Point 2013 using rest API

I have one requirement to implement pagination in sharePoint 2013 using rest api. 我有一个要求,需要使用rest api在sharePoint 2013中实现分页。

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: 我已经尝试使用以下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. 如果我会给ID列而不是startdate的工作罚款。

Can any one suggest how to use startdate column in querystring while using skiptoken? 有人可以建议在使用skiptoken时如何在查询字符串中使用startdate列吗?

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') 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. 谢谢,丹尼(Danny)请记住,如果有帮助,请标记为答案;如果有帮助,请投票。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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