sgjsakura / AspNetCore

ASP.NET Core Extension Library
Apache License 2.0
162 stars 26 forks source link

Pager is appending extra links after click #24

Closed Naturesromance closed 7 years ago

Naturesromance commented 7 years ago

I am using the pager for 67 pages. The pager initially displays with 1 2 3 ... 65 66 67. When I click on the page 3 link, the pager is now 1 2 3 4 5 ... 65 66 67. If I then click on page 65 link, the pager is 1 2 3 ... 63 64 65 66 67.

I know there must be something simple that I am missing but I have been racking my brain for the last day and half. Any help would be greatly appreciated.

sgjsakura commented 7 years ago

@Naturesromance Hi, thank you for your feedback. Defaultly, the pager will show 3 items in both starting and ending, the current page item, and 2 extra items in both left and right side for current page. The effect described in your issue seems work correctly, and could you tell me what's the exact effect you want in your application?

Hope for your kind reply :-)

Naturesromance commented 7 years ago

Thank you for your quick response. I am wondering if the following example is correct behavior. First I click on page 3. Next I click on page 4. The result is 1 2 3 4 5 6 ... 65 66 67. I assumed that it would be displayed as ... 2 3 4 5 6 ... 65 66 67. I thought there should only be two pages left of the active page 4.

pager

sgjsakura commented 7 years ago

@Naturesromance Actually, as the default setting, the pager will try to display 3 ending pages for both side (1,2,3 65,66,67), the current page (4), and 2 extra pages in both side (2,3,5,6). The final merged result just looks as your supplied image below, and the pager is working correctly.

If you want to chagne the page number to show in ending and/or current page, you may change the PagerOptions, for more information, please read the documentation and feel free to open new issues if you have any question.

I'm closing this issue since there is no incorrect behavior.