API Docs for: 1.0.0
Show:

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 Pagintor

    Paginator instance to attach to

Methods

destroy

() private

Removes the link/span node and clears event listeners removal.

render

(
  • id_base
)
HTMLElement

Generate the span containing info formatted per the pageReportTemplate attribute.

Parameters:

  • id_base String

    used to create unique ids for generated nodes

Returns:

HTMLElement:

sprintf

(
  • template
  • values
)
String static

Replace place holders in a string with the named values found in an object literal.

Parameters:

  • template String

    The content string containing place holders

  • values Object

    The key:value pairs used to replace the place holders

Returns:

String:

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:

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