a holder object for paged data
Type Params | Return Type | Name and description |
---|---|---|
|
void |
eachPage(Closure c) Calls passed closure for each page |
|
Map |
getJsonData() Returns formatted page with next values page is the page we are on, total is the total number f pages based on max per page setting records is the total # of records we have rows are the data |
|
Integer |
getOffset() Calculates offset based on page number and max value |
|
Integer |
getPageCount() Calculates total number of pages |
|
static Integer |
max(Map p, Integer defaultMax = 100) Computes max value, if max not specified, then 10 Default max allowed value is 100 |
|
static Integer |
page(Map p) Computes page number, if not passed then 1 |
|
void |
setParams(Map params) Set params for Pager |
|
Pager |
setupData(List dlist, List fieldList = null) Setup totalCount property for list, if it absent and fill values that are listed in fieldList |
|
static Integer |
toInteger(Object v) Converts object to integer |
the max rows the user can set it to
List of elements
Max rows to show
Offset max * (page - 1)
The page we are on
Parameters
The total record count. This is used to calculate the number of pages
Constructor without params
Constructor with params
Calls passed closure for each page
c
- closure that should be called for pagesReturns formatted page with next values page is the page we are on, total is the total number f pages based on max per page setting records is the total # of records we have rows are the data
Calculates offset based on page number and max value
Calculates total number of pages
Computes max value, if max not specified, then 10 Default max allowed value is 100
p
- map of params that may contain max valuedefaultMax
- default max value if max in params isnt setComputes page number, if not passed then 1
p
- map of paramsSet params for Pager
params
- map of paramsSetup totalCount property for list, if it absent and fill values that are listed in fieldList
dlist
- list of entitiesfieldList
- list of fields names which values should be in the result list based on dlistConverts object to integer
v
- valueGroovy Documentation