Page it!
With this lib you can fully manipulate pagination events and fetch information from an endpoint.
Also you can, in fact you must (if you want to use it), integrate this tool with your own pagination component.
Instalation
Download it via npm
:
npm i jquery.page-it@latest --save
Available Methods
Methods | Params | Description |
---|
first | void | Loads first page. |
prev | void | Loads previous page. |
next | void | Loads next page. |
last | void | Loads last page. |
to | {int} pageIndex | Loads the specifyied page. |
on | {string} eventName, {callable} callback | Registers an event listener. |
trigger | {string} eventName, {object} data | Triggers an event. |
setMeta | {object} meta | Sets the meta property, this property is used to control pagination numbers. |
setCurrent | {object} requestData | Accepts a callback to update the request data. |
setRequestData | {int} current | Sets the current page and updates dependent meta. |
Options
Default options are:
{
autoStart: false,
cache: true,
ajax: {
url: '',
cache: false,
global: true,
},
replace: null,
meta: metaSchema
}