GustavAT / Paginator.js

A simple paginator in JavaScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Paginator.js

Paginator.js is still in progress

Client-side paginator that includes the following features:

  • Scrolling through pages and jumping to the first/last page using the buttons in the navigation bar.
  • Sorting the content by clicking on the header of a column if it isn't disabled by the user.
  • Sorting the content using a specified type, i.e. string, number, date etc.
  • Showing/hiding the header, navigation bar or specified columns
  • Hiding navigation bar if only a few items, filling table with empty lines etc.

Paginator

>> JSFiddle Life Demo

JSFiddle Demos currently only working on firefox

###Usage

  • Create a new empty div-block with an id:
<div id="paginator" style="width: 400px"></div>
  • Define Columns:
var header = ["#", "Product", "Price"];
  • Specify your content:
var entries = [];
entries.push([1, "Fish", 2.49]);
entries.push([2, "Apple", 0.99]);
// add some more products
  • Define some options:
var options = {};
options.types = ["number", "string", "number"];
options.maxRows = 4;
options.defaultColumn = 1;
// have a look at documentation for all options
  • Create a new Paginator instance and pass the parameters:
var paginator = new Paginator("paginator", entries, header, options);

Paginator

Full documentation and examples comming soon

About

A simple paginator in JavaScript.

License:MIT License


Languages

Language:JavaScript 87.7%Language:CSS 12.3%