简体   繁体   中英

Server-side paging but at the cost of losing sorting

I have implemented server-side paging at 10 items per page for 1000 item result set, so that it pages 10 items per page. When I had it client side, I could page 10 at a time and if I sorted, it would sort against the entire 1000 items, but only show 10 items per page. However, using server-side paging where my REST call only returns 10 items at a time, my sorting is only within 1 page at a time since it can't compare against the other 990 items that are not called yet.

Given this, how is it possible to have server side paging and sorting across the entire total items? This assumes I am using REST/JSON presented using AngularJS.

What is interesting is that in my REST call using a tool like Postman, it properly maintains the overall order even with skips, but with the pagination calls in my Angular app, it only orders within the items (ex. 10).

我发现了这个问题,我在REST调用中还有一些额外的代码仍在页面上与orderby冲突的页面上进行排序。

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