Pager Helper

Last Updated 3/5/2015
Allows users to navigate through multiple pages of data

@BRT.Pager()

Required Parameters

pageNumber - the current page number
And
pageCount - the number of pages
Or
recordList - a list of records used to get the pageNumber and pageCount

Optional Parameters

  • options - a set of PagerOptions that control output
    • PagerOptions.QueryString - use the querystring (links use href)
    • PagerOptions.Ajax - use ajax (links hava a data-id attribute instead of hrefs)
    • PagerOptions.Bootstrap - use Bootstrap styles
  • spanPages - the number of links before and after the current page spanned by the pager
  • template - A template used to render the pager. It receives two properties
    • item.pageNumber
    • item.pageCount

Example Result (Default style/QueryString)

<div class="brt-pagination">
	<span>Page 1 of 3</span>
	<span>
		<a href="/friendly">1</a>
		<a href="/friendly?page=2">2</a>
		<a href="/friendly?page=3">3</a>
		<a href="/friendly?page=2">next</a>
	</span>
</div>

Example Result (Bootstrap/Ajax)

<div class="pagination">
	<span>Page 1 of 4</span>
	<ul>
		<li><a href="#" data-page="1">1</a></li>
		<li><a href="#" data-page="2">2</a></li>
		<li><a href="#" data-page="3">3</a></li>
		<li><a href="#" data-page="4">4</a></li>
		<li><a href="#" data-page="2">next</a></li>
	</ul>
</div>

Article Topics

For Developers

Want to learn more?

Call 800-924-5220 or

Free trial