2.0.2 • Published 8 years ago

mithril-node-pagination v2.0.2

Weekly downloads
22
License
-
Repository
github
Last release
8 years ago

mithril-node-pagination

A simple pagination component for Mithril and NodeJS.

Usage

const pagination = require('mithril-node-pagination');

const model = {
    "page": 2,
    "size": 10,
    "totalPages": 5,
    "total": 50,
    "more": true,
    "url": "go/to/page/${page}"
    ...
}

const ctrl = pagination.controller(model);
const view = pagination.view(ctrl);

Options

  • page: Page number.
  • size: size of each page.
  • totalPages: Total number of pages.
  • total: Total number of record available.
  • more: True if more pages exist.
  • pattern: URL template for pagination. Default is "${page}"

Test

Setup mithril-component-tools first. Then:

npm install
mct test pagination.js en
2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago