Paging in a custom Module

Topics: Writing modules
Aug 7, 2012 at 12:25 PM

Hi,

I have written a custom module that connect to Microsoft Dynamics NAV, gets some data and returns it within my controller, I have then been able to figure out how to get the paging to work, my only issue is that the paging controls just render 'Older', then when I click that it also show 'Newer'.

I was expecting it to show page numbers... have I missed something or do I have to do this myself - and if so any pointers.

So far enjoying working within Orchard and learing it!

Thanks

Roland

Aug 7, 2012 at 2:12 PM

var pager = new Pager(_siteService.GetSiteSettings(), pagerParameters);

CustomShape.Content.Add(Shape.Pager(pager).TotalItemCount(totalCount), "Content:after");

And limit your items with pager.GetStartIndex(), pager.PageSize

succes!

Aug 8, 2012 at 12:38 PM

I know what you mean, but I was more interested in how to render it differently.

Found something here for anyone else that might come across this...

http://stackoverflow.com/questions/11086459/orchard-cms-1-4-2-how-to-add-a-pager-to-a-projection?rq=1