Skip to content

Instantly share code, notes, and snippets.

@vmencik
Created February 23, 2013 09:18
Show Gist options
  • Save vmencik/5019094 to your computer and use it in GitHub Desktop.
Save vmencik/5019094 to your computer and use it in GitHub Desktop.
Initialization of PaginationData before it is passed to a template
object Pagination {
def apply[T](page: ListPage[T], pageSize: Int)(navi: Int => Call): PaginationData = {
val pd = new PaginationData
pd.setPageSize(pageSize)
pd.setRunover(page.runover)
pd.configure(page.totalCount, page.firstIndex)
pd.setAddressAdapter(new PageAddressAdapter {
override def makePageAddress(offset: Int): Call = navi(offset)
})
pd
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment