Permalink
Browse files

Fix issue #1388 - Allow Paginator to send correct page links on ajax

  • Loading branch information...
kjozsa authored and fmpwizard committed Jan 5, 2013
1 parent df40d43 commit 9f3e18769d358b74d5586b05e215afe866263770
Showing with 11 additions and 1 deletion.
  1. +6 −0 contributors.md
  2. +5 −1 web/webkit/src/main/scala/net/liftweb/http/Paginator.scala
View
@@ -95,3 +95,9 @@ Ali Salim Rashid
### Email: ###
a.rashid at zantekk dot com
+
+### Name: ###
+Kristof Jozsa
+
+### Email: ###
+kristof.jozsa at gmail dot com
@@ -187,10 +187,14 @@ trait PaginatorSnippet[T] extends Paginator[T] {
* Sets the default starting record of the page (URL query parameters take precedence over this)
*/
def first_=(f: Long) = _first = f max 0 min (count-1)
+ /**
+ * Set base URI for pagination when snippet loads
+ */
+ val paginationBaseUri = S.uri
/**
* Returns a URL used to link to a page starting at the given record offset.
*/
- def pageUrl(offset: Long): String = appendParams(S.uri, List(offsetParam -> offset.toString))
+ def pageUrl(offset: Long): String = appendParams(paginationBaseUri, List(offsetParam -> offset.toString))
/**
* Returns XML that links to a page starting at the given record offset, if the offset is valid and not the current one.
* @param ns The link text, if the offset is valid and not the current offset; or, if that is not the case, the static unlinked text to display

0 comments on commit 9f3e187

Please sign in to comment.