API Docs for: 1.0.0
Show:

Paginator.ui.PageLinks Class

ui Component to generate the page links

Constructor

Methods

calculateRange

(
  • currentPage
  • [totalPages]
  • [numPages]
)
Array static

Calculates start and end page numbers given a current page, attempting to keep the current page in the middle

Parameters:

  • currentPage Int

    The current page

  • [totalPages] Int optional

    Maximum number of pages

  • [numPages] Int optional

    Preferred number of pages in range

Returns:

Array:

[start_page_number, end_page_number]

destroy

() private

Removes the page links container node and clears event listeners

onClick

(
  • e
)

Listener for the container's onclick event. Looks for qualifying link clicks, and pulls the page number from the link's page attribute. Sends link's page attribute to the Paginator's setPage method.

Parameters:

  • e DOMEvent

    The click event

rebuild

(
  • e
)

Force a rebuild of the page links.

Parameters:

render

(
  • id_base
)
HTMLElement

Generate the nodes and return the container node containing page links appropriate to the current pagination state.

Parameters:

  • id_base String

    used to create unique ids for generated nodes

Returns:

HTMLElement:

update

(
  • e
)

Update the links if appropriate

Parameters:

Properties

container

HTMLElement private

Span node containing the page links

current

Number private

Current page

templates

Unknown static

Templates for generating page links.

Attributes

currentPageClass

CSS class assigned to the current page span.

Default: 'yui-paginator-current-page'

pageLabelBuilder

Function used generate the innerHTML for each page link/span. The function receives as parameters the page number and a reference to the paginator object.

Default: function (page, paginator) { return page; }

pageLinkClass

CSS class assigned to each page link/span.

Default: 'yui-paginator-page'

pageLinksContainerClass

CSS class assigned to the span containing the page links.

Default: 'yui-paginator-pages'