new ListRenderer(coll, renderer)
Parameters:
Name | Type | Description |
---|---|---|
coll |
HopObject | ArrayList | Array | The collection this ListRenderer operates on, or - for backwards compatibility only - a parameter object containing the collection and any other optional configuration parameters. |
renderer |
Object | An optional renderer to use. If this is set, any rendering method defined in this renderer overrides the default renderer. |
- Source:
Classes
Members
(static, readonly) defaultRenderer
Default Renderer object containing functions
used for rendering different list items (eg. page navigation,
prev/next links and list items).
- Source:
Methods
currentEnd_macro()
Returns the end item number in the current page
- Source:
Returns:
The end item number in the current page
currentPage_macro()
Returns the current page number
- Source:
Returns:
The current page number
currentStart_macro()
Returns the start item number in the current page
- Source:
Returns:
The start item number in the current page
getBaseHref()
Returns the base href of this ListRenderer instance
- Source:
Returns:
The base href of this ListRenderer instance
getCollection()
Returns the collection this ListRenderer instance operates on
- Source:
Returns:
The collection of this ListRenderer
getCurrentPage()
Returns the current page index. This is either the page url parameter
or the page number 1.
- Source:
- See:
Returns:
The current page number (starts with 1).
getEndIndex()
Returns the zero-based index position of the last item of the current page
in the collection this ListRenderer operates on.
- Source:
Returns:
The index position of the last item in the list
getItemSkin()
Returns the name of the skin rendered for a single list item
- Source:
Returns:
The name of the list item skin
getList(param)
Returns the rendered list of collection items as string
Parameters:
Name | Type | Description |
---|---|---|
param |
Object | Object containing extra parameters (e.g. from a macro call). |
- Source:
- See:
Returns:
The rendered list
getMaxDayDate()
Gets the Date offset indicated by parameter maxDays as Number for runtime efficent comparison
- Source:
getMaxDays()
Returns the maximum number of days handled by this ListRenderer instance
- Source:
Returns:
The maximum number of days
getMaxPages()
Returns the maximum number of pages handled by this ListRenderer instance
- Source:
Returns:
The maximum number of pages
getNextItem() → {Object}
- Source:
Returns:
the next Item
- Type
- Object
getNextLink(param)
Returns a rendered link to the previous page as string. For performance
reasons this method caches the rendered link in the local cache of this
ListRenderer instance.
Parameters:
Name | Type | Description |
---|---|---|
param |
Object | Object containing extra parameters (e.g. from a macro call). |
- Source:
- See:
Returns:
A rendered link to the previous page
getPageHref(page)
Returns the href of a page. If no argument is given, the href
of the current page is returned. Any URL parameters set with
#setUrlParameters are added to the href.
Parameters:
Name | Type | Description |
---|---|---|
page |
Number | The optional page number to include in the href. |
Returns:
The href of the page
getPageNavigation(param)
Returns the rendered page navigation bar as string
Parameters:
Name | Type | Description |
---|---|---|
param |
Object | Object containing extra parameters (e.g. from a macro call). |
- Source:
- See:
Returns:
The rendered page navigation
getPageSize()
Returns the number of items displayed on one page
- Source:
Returns:
The number of items displayed on a single page
getPrevLink(param)
Returns a rendered link to the previous page as string. For performance
reasons this method caches the rendered link in the local cache of this
ListRenderer instance.
Parameters:
Name | Type | Description |
---|---|---|
param |
Object | Object containing extra parameters (e.g. from a macro call). |
- Source:
- See:
Returns:
A rendered link to the previous page
getRenderer()
Returns the renderer used by this ListRenderer instance
- Source:
getStartIndex()
Returns the zero-based index position of the first item of the current page
in the collection this ListRenderer operates on.
- Source:
Returns:
The index position of the first item in the list
getTotalPages()
Returns the total number of pages handled by this ListRenderer instance
(which is the collection size divided by the page size).
- Source:
Returns:
The total number of pages
getUrlParameterName()
Returns the name of the URL parameter name containing the index
of the page to display
- Source:
Returns:
The name of the page URL parameter name
getUrlParameters()
Returns any additional URL parameters included in every navigation link
rendered by this ListRenderer instance.
- Source:
Returns:
A string containing additional URL parameters
hasNext() → {Boolean}
- Source:
Returns:
wether there is a next item
- Type
- Boolean
limit_macro(param)
Either renders the maximum number of items per page, or
sets the limit to a given number.
Parameters:
Name | Type | Description |
---|---|---|
param |
Object | Extra macro parameters:
|
- Source:
Returns:
The current maximum number of items per page
nextLink_macro(param)
Returns a rendered link to the next page.
Parameters:
Name | Type | Description |
---|---|---|
param |
Object | Extra macro parameters:
|
- Source:
- See:
Returns:
A rendered link to the next page
pageNavigation_macro(param)
Returns the rendered page navigation bar.
Parameters:
Name | Type | Description |
---|---|---|
param |
Object | Extra macro parameters:
|
- Source:
- See:
Returns:
The rendered page navigation bar
prevLink_macro(param)
Returns a rendered link to the previous page.
Parameters:
Name | Type | Description |
---|---|---|
param |
Object | Extra macro parameters:
|
- Source:
- See:
Returns:
A rendered link to the previous page
renderList(param)
Renders the list of items for one page directly to response.
Parameters:
Name | Type | Description |
---|---|---|
param |
Object | Object containing extra parameters (e.g. from a macro call). |
- Source:
- See:
renderListAsString(param)
Returns the rendered list of collection items as string
Parameters:
Name | Type | Description |
---|---|---|
param |
Object | Object containing extra parameters (e.g. from a macro call). |
- Deprecated:
- Use #getList instead
- Source:
- See:
Returns:
The rendered list
renderNextLink(param)
Renders a link to the next page directly to response.
Parameters:
Name | Type | Description |
---|---|---|
param |
Object | Object containing extra parameters (e.g. from a macro call). |
- Source:
- See:
renderNextLinkAsString()
Returns a rendered link to the previous page as string
- Deprecated:
- Use #getNextLink instead
- Source:
Returns:
A rendered link to the next page
renderPageNavigation(param)
Renders the page navigation bar directly to response. For performance reasons
this method caches the rendered page navigation in the local cache of this
ListRenderer instance.
Parameters:
Name | Type | Description |
---|---|---|
param |
Object | Object containing extra parameters (e.g. from a macro call). |
- Source:
- See:
renderPageNavigationAsString()
Returns the rendered page navigation bar as string
- Deprecated:
- Use #getPageNavigation instead
- Source:
Returns:
The rendered page navigation bar
renderPrevLink(param)
Renders a link to the previous page directly to response.
Parameters:
Name | Type | Description |
---|---|---|
param |
Object | Object containing extra parameters (e.g. from a macro call). |
- Source:
- See:
renderPrevLinkAsString(param)
Returns a rendered link to the previous page as string
Parameters:
Name | Type | Description |
---|---|---|
param |
Object | Object containing extra parameters (e.g. from a macro call). |
- Deprecated:
- Use #getPrevLink instead
- Source:
Returns:
A rendered link to the previous page
render_macro(param)
Renders the current page of this list.
Parameters:
Name | Type | Description |
---|---|---|
param |
Object | Extra macro parameters:
|
- Source:
- See:
setBaseHref(href)
Sets the base href of this ListRenderer instance. All links rendered
will start with the href passed as argument
Parameters:
Name | Type | Description |
---|---|---|
href |
String | The base href to use for rendering links |
- Source:
setCollection(coll)
Sets the collection of this ListRenderer
Parameters:
Name | Type | Description |
---|---|---|
coll |
HopObject | ArrayList | Array | The collection this ListRenderer instance should operate on |
- Source:
setItemSkin(name)
Sets the name of the skin to render for every list item
Parameters:
Name | Type | Description |
---|---|---|
name |
String | The name of the skin to render for every list item |
- Source:
setMaxDays(days)
Sets the maximum number of days to display
Parameters:
Name | Type | Description |
---|---|---|
days |
Number | The maximum number of days to display |
- Source:
setMaxPages(pages)
Sets the maximum number of pages to display
Parameters:
Name | Type | Description |
---|---|---|
pages |
Number | The maximum number of pages to display |
- Source:
setPageSize(size)
Sets the number of items to display on a single page
Parameters:
Name | Type | Description |
---|---|---|
size |
Number | The number of items to display on one page |
- Source:
setRenderer(r)
Sets the renderer to be used by this ListRenderer instance
Parameters:
Name | Type | Description |
---|---|---|
r |
Object | The renderer to use |
- Source:
setUrlParameterName(name)
Sets the name of the URL parameter name containing the index of the page
to display
Parameters:
Name | Type | Description |
---|---|---|
name |
String | The name of the page URL parameter |
- Source:
setUrlParameters(params)
Sets additional parameters to include in every navigation link
Parameters:
Name | Type | Description |
---|---|---|
params |
String | A string to append to every navigation URL |
- Source:
size_macro()
Returns the total number of items
- Source:
Returns:
The total number of items in the collection this ListRenderer
instance is working on
totalPages_macro()
Returns the total number of pages
- Source:
Returns:
The total number of pages available