Is there a way to limit the displayed numbers in pagination?
Closed this issue · 9 comments
for example I have 20 pages. What I want to see first in my page is just 1-5 rather than the usual display 1-5..19 20
something like the traditional pagination design to be more specific.
Hey Ryan,
I don't quite follow what you are asking, do you have a link to an image of the traditional pagination design you are referencing?
If you are interested in just showing pages 1 through 5 and not showing the other pages, you would need to perform some simple math to calculate the correct the total
to pass into the directive - But I get the impression you are looking for something else.
I'll keep this issue open until we can get you a solid answer and thanks for checking out the directive!
What append if :
the current page is 4, this will be OK? : < 2 3 4 5 6 >
If the last page & current is 6? : < 2 3 4 5 6
👍 @optyler
Thanks Ryan, very helpful, I think I see what you are after.
To answer your question, the dots are always visible unless there are to few pages to display.
I've included a sample case below which hides the dots - although does not fully meet your request.
Visually the goal is to allow the user to always view the outer paging limits
It certainly is possible to achieve what you are after however it would require code changes.
I'll mark this as an enhancement for now as others may enjoy a more compact paging scheme
<!-- Example state which hides dots -->
<div paging
page="3"
page-size="10"
total="50">
</div>
thanks @brantwills !
Added granularity to show and hide first and last arrows
See release v2.1.0
Thanks! Happy new year!