New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
would you consider an option to pass in total pages instead of total items? #45
Comments
hi Joe It wouldn't be very hard to program an alternative/overload but I'm having a hard time to see how to get that into the public interface. I assume that the alternative interface would be something like:
This is exactly the same signature as the existing method. An alternative I can think of is adding a new option that indicates that totalItemCount means totalPages, but that's quite hacky in my opinion. Ideas? |
Hi Martijn, Yes, I thought that might be a problem.
or after aspnet vnext the object could be an assembly neutral interface or if you don't like that idea, what about an alternate method name to avoid the signature clash? I guess the hard part is thinking of a good alternate name |
After having given it a little bit more thought I think the least intrusive way is to add an extra option. Not pretty, but easy to program and not too hard to use:
The main advantage of adding it as an option is that most users probably won't notice. |
That seems like a reasonable solution to me, I understand the other alternatives are even less pretty. |
Alright let's do it. |
Excellent! Thank You! I'll keep an eye out for the next Nuget update. |
…rn the total number of pages instead of the total number of items. Fixes issue #45.
New version is on NuGet. Enjoy! |
Wow! That was fast! Thank you very much! |
I confirm it is working great! Many thanks! |
Good to hear. Closing the issue :) |
Hi Martijn,
I started working on my own pager for mvc but found yours which looks very nice. One problem for me is that the project I'm working on already has data access methods for returning a page of data, we pass in the page size and current page number and it gives us totalPages as an output parameter rather than totalItems.
I was wondering if you would consider implementing support/overloads for passing that in as an alternative to totalItems which is currently used to calculate totalpages inside the pager code?
Thanks,
Joe
The text was updated successfully, but these errors were encountered: