Class: ListPager

nyc/ListPager~ ListPager


new ListPager(options)

Create an instance of ListPager

Parameters:
Name Type Description
options module:nyc/ListPager~ListPager.Options

Constructor options

Source:
Fires:

Extends

Methods


append(elements)

A method to append elements to the container

Parameters:
Name Type Description
elements jQuery | Element | Array.<Element> | string

The element to append

Inherited From:
Overrides:
Source:
Returns:

The container

Type
jQuery

find(selector)

A method to return elements in the container

Parameters:
Name Type Description
selector string

jQuery selector

Inherited From:
Overrides:
Source:
Returns:

The element

Type
jQuery

getContainer()

A method to return a control container HTML element wrapped in a JQuery

Inherited From:
Overrides:
Source:
Returns:

The the control container HTML element wrapped in a JQuery

Type
jQuery

next( [first] [, pageSize])

Renders and returns next page of items

Parameters:
Name Type Argument Default Description
first boolean <optional>
false

Transfer focus to the first item

pageSize number <optional>
10

The length of the items for the next page

Source:
Returns:

List of items on the next page

Type
Array.<module:nyc/ListPager~ListPager.Item>

off(eventName, evtHdlr [, hdlrScope])

Remove a previously connected event handler

Parameters:
Name Type Argument Description
eventName string

The name of the event to which the handler will be connected

evtHdlr function

The event handler function

hdlrScope Object <optional>

The scope in which to invoke the event handler

Inherited From:
Overrides:
Source:

on(eventName, evtHdlr [, hdlrScope])

Connect a function to an event

Parameters:
Name Type Argument Description
eventName string

The name of the event to which the handler will be connected

evtHdlr function

The event handler function

hdlrScope Object <optional>

The scope in which to invoke the event handler

Inherited From:
Overrides:
Source:

one(eventName, evtHdlr [, hdlrScope])

Connect a function to an event for a single invocation

Parameters:
Name Type Argument Description
eventName string

The name of the event to which the handler will be connected

evtHdlr function

The event handler function

hdlrScope Object <optional>

The scope in which to invoke the event handler

Inherited From:
Overrides:
Source:

prepend(elements)

A method to prepend elements to the container

Parameters:
Name Type Description
elements jQuery | Element | Array.<Element> | string

The element to append

Inherited From:
Overrides:
Source:
Returns:

The container

Type
jQuery

reset( [items])

Resets the pager with new items and show the first page

Parameters:
Name Type Argument Description
items Array.<module:nyc/ListPager~ListPager.Item> <optional>

The items to page through

Source:
Returns:

List of items on the next page

Type
Array.<module:nyc/ListPager~ListPager.Item>

trigger(eventName [, data])

Trigger a named event with event data

Parameters:
Name Type Argument Description
eventName string

The name of the event to trigger

data Object <optional>

The event data

Inherited From:
Overrides:
Source:

Type Definitions


Item

Object containing a rendering function for an item

Type:
Properties:
Name Type Description
html function

The rendering function for the item

Source:

Options

Constructor options for module:nyc/ListPager~ListPager

Type:
  • Object
Properties:
Name Type Description
target jQuery | Element | string

The DOM node in which to create the ListPager

Source:

Events


change

The change event

Type: module:nyc/ListPager~ListPager
Source: