2

I have 10 items with ID from 1 to 10 and set order by on Created field Ascending='FALSE'. Row Limit is 3. I use SPListItemCollectionPosition for pagination to limit the number of returned items. First query, I get only 3 items, namely 10, 9 and 8 in order. Second, I need to get expected items, namely 7, 6 and 5, but I get incorrect results.

I have read some articles that tell me to use the syntax, that I pass ID of the first second results set and its value of sort field, Created field, like:

Paged=TRUE&p_FSObjType=0&PagedPrev=TRUE&p_Created=20150818 07:02:48&p_ID=7

However, the query returns items with id 4, 3 and 2?

I also use the syntax "Paged=TRUE&PagedPrev=TRUE&p_Created={0}&p_ID={1}" but the result is still wrong. As far as I understand here is that the query gets items, start from the first item on the list (ID=1) and get only three items, which is set by row limit, and then sort them by Created field.

Some tell me that I could capture the first and the last item of the results etc, but in my case, I only have one way backward.

Please give me advice.

1 Answer 1

2

Here is the Similar Question Paging. You can get the nextPagingInfo using OOTB function

nextPagingInfo = spItems.get_listItemCollectionPosition().get_pagingInfo();

You need to frame the prevPagingInfo and "Created" doesn't work for sorting. Use "Created_x0020_Date" instead.You can get the Original Source Code form MSDN. I used angular with this function and works very well.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.