Paginator.ui.CurrentPageReport Class
ui Component to generate the textual report of current pagination status. E.g. "Now viewing page 1 of 13".
Constructor
Paginator.ui.CurrentPageReport
-
p
Parameters:
-
p
PagintorPaginator instance to attach to
Item Index
Properties
Methods
destroy
()
private
Removes the link/span node and clears event listeners removal.
render
-
id_base
Generate the span containing info formatted per the pageReportTemplate attribute.
Parameters:
-
id_base
Stringused to create unique ids for generated nodes
Returns:
sprintf
-
template
-
values
Replace place holders in a string with the named values found in an object literal.
Parameters:
-
template
StringThe content string containing place holders
-
values
ObjectThe key:value pairs used to replace the place holders
Returns:
update
-
e
Regenerate the content of the span if appropriate. Calls CurrentPageReport.sprintf with the value of the pageReportTemplate attribute and the value map returned from pageReportValueGenerator function.
Parameters:
-
e
CustomEventThe calling change event
Properties
span
HTMLElement
private
Span node containing the formatted info
Attributes
pageReportClass
CSS class assigned to the span containing the info.
Default: 'yui-paginator-current'
pageReportTemplate
Used as innerHTML for the span. Place holders in the form of {name} will be replaced with the so named value from the key:value map generated by the function held in the pageReportValueGenerator attribute.
Default: '({currentPage} of {totalPages})'
pageReportValueGenarator
Function to generate the value map used to populate the pageReportTemplate. The function is passed the Paginator instance as a parameter. The default function returns a map with the following keys:
- currentPage
- totalPages
- startIndex
- endIndex
- startRecord
- endRecord
- totalRecords