Home

Awesome

Pager

Build Status Coverage Status

A pager component works with list of no effort Pager(list)

Object.defineProperty is used for binding properties in list.

Features

Install

npm i component-pager

Usage

var Pager = require('pager')
var Grid = require('exgrid')
var grid = new Grid(template)
var pager = new Pager(grid)
var parent = document.getElementById('grid')
parent.appendChild(grid.el)
parent.appendChild(pager.el)

Events

API

Pager([list], [opts])

Init pager with optional binding list

Pager#bind(list, opts)

Bind to list with optional options

Pager#total(n)

Set the total number of items to n.

Pager#limit(n)

Limit the shown page numbers to n

Pager#perpage(n)

Set the number of items per page to n. [5]

Pager#pages()

Return the total number of pages.

Pager#show(n)

Select page n, .render(), and emit "show".

Pager#select(n)

Select page n and .render().

Pager#render()

Re-render the pager.

License

MIT