Commit 193a57d
committed
controllers/helpers/pagination: Maintain consistent ordering from page to page
For instance, given rows with the following:
| a | b | c | ... | 1 | 2 | 3 |
When performing forward seek pagination with page size as 3 to the last
page, let's say we have the last page as 1, 2, 3. When performing
backward seek pagination, we reverse the order of the query so that we
can retrieve the data from the tail. This results in 3, 2, 1. However,
we would like to maintain consistent ordering as we view it with forward
pagination, namely 1, 2, 3. Therefore, we need to reverse the results
again to maintain the original ordering.1 parent 454f35d commit 193a57d
1 file changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
| 316 | + | |
317 | 317 | | |
318 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
319 | 322 | | |
320 | 323 | | |
321 | 324 | | |
| |||
467 | 470 | | |
468 | 471 | | |
469 | 472 | | |
470 | | - | |
| 473 | + | |
471 | 474 | | |
472 | | - | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
473 | 479 | | |
474 | 480 | | |
475 | 481 | | |
| |||
0 commit comments