class
SAPO.Ink.Pagination
Version:
0.1
Generic pagination component.
Since:
Defined in
Ink/Pagination/0.1/lib.js
October 2012
Constructor Summary
Function Summary
destroy()
unregisters the component and removes its markup from the DOM
Number
getCurrent()
returns current page
Number
getSize()
returns the number of pages
Boolean
hasNext()
returns true iif has page(s) ahead
Boolean
hasPrevious()
returns true iif has prior page(s)
Boolean
isFirst()
returns true iif at first page
Boolean
isLast()
returns true iif at last page
sets the current page
setSize
(Number
sz)
sets the number of pages
Constructor Details
constructor Pagination
Pagination(String|DOMElement
selector, Object
options)
Parameters:
selector
options
-
Number size
number of pages -
[ String previousLabel ]
label to display on previous page button -
[ String nextLabel ]
label to display on next page button -
[ Function onChange ]
optional callback -
[ Boolean setHash ]
if true, sets hashParameter on the location.hash. default is disabled -
[ String hashParameter ]
parameter to use on setHash. by default uses 'page'
Function Details
function destroy
destroy()
unregisters the component and removes its markup from the DOM
function getCurrent
Number
getCurrent()
returns current page
function getSize
Number
getSize()
returns the number of pages
function hasNext
Boolean
hasNext()
returns true iif has page(s) ahead
function hasPrevious
Boolean
hasPrevious()
returns true iif has prior page(s)
function isFirst
Boolean
isFirst()
returns true iif at first page
function isLast
Boolean
isLast()
returns true iif at last page
function setCurrent
setCurrent(Number
nr, Boolean
isRelative)
sets the current page
Parameters:
nr
sets the current page to given number
isRelative
trueish to set relative change instead of absolute (default) function setSize
setSize(Number
sz)
sets the number of pages
Parameters:
sz
number of pages