Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mercmobily/hot-pager


https://github.com/mercmobily/hot-pager

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

`hot-pager`
Pager element for Hotplate

This is a very simple, basic pager. All it does is display all of the pagerData items, using a dom-repeat template.

A common way of using it is a follows;






Name: {{item.name}}

Surname: {{item.surame}}



Here:

* `hot-network` is used to make sure that network resilience is handled. Note that hot-network's target is the `iron-ajax` element. This is strongly recommended.
* The `iron-ajax` element is wrapper with `hot-ajax-paging`. This will make sure that `idon-ajax` has the right headers set for each request, depending of what page is requested.
* The data (coming from the bound property `data` in `iron-ajax`) is displayed with a typical `dom-repeat`
* The pager is used, passing it `pagerData`. Here, `pagerData` will always be changed by `hot-ajax-paging`, and will depend on the page requested by the user as well as the number of results returned by the AJAX query

This is only example code. Custom pagers could show more information (such as the total number of records, etc.) and look very different. This is a basic starting point, where the most commong example of pagination is shown.

Most importantly, _all_ possible calculations are already done in `pagerData`.