0

Problem: I have a database result set of n. I want to have k < n index links to the results on a html page. There should be more index links near the cursor, have the user forward +5 is more probable than to forward +50

Idea is to have a number line on a rubber band with markings, if I put a weight on the cursor point and view from above I should have the index points.

enter image description here

Is there an easy algorithm for this?

Same problem would be for an index to forum messages.

weberjn
  • 1,840
  • 20
  • 24

1 Answers1

0

@le_m Thanks for pointing me to pagination.

So I found

Smart pagination algorithm

https://blog.codinghorror.com/the-end-of-pagination/

http://ui-patterns.com/patterns/Pagination

I ended with implementing it myself in Java as https://github.com/weberjn/jBM/blob/master/model/src/main/java/de/jwi/jbm/model/PagePosition.java

My original idea was too complicated.

Community
  • 1
  • 1
weberjn
  • 1,840
  • 20
  • 24