Home

Awesome

Kurounin:Pagination-Blaze

This package provides a bootstrap 3 and 4 paginator Blaze template to be used with the kurounin:pagination package. It can also be configured to use custom styling.

Usage

In the template helpers you need to define a helper to return the pagination instance and you can define an optional callback which should be called right before changing the page

Template.myList.helpers({
    templatePagination: function () {
        return Template.instance().pagination;
    },
    clickEvent: function() {
        return function(e, templateInstance, clickedPage) {
            e.preventDefault();
            console.log('Changing page from ', templateInstance.data.pagination.currentPage(), ' to ', clickedPage);
        };
    }
});

In the template html file add the paginator

{{> defaultBootstrapPaginator pagination=templatePagination onClick=clickEvent limit=10 containerClass="text-center"}}

For Semantic UI, use the following configuration

{{> defaultBootstrapPaginator pagination=templatePagination onClick=clickEvent limit=10 paginationClass="ui pagination menu" itemClass="item" wrapLinks=false}}

Available template parameters are: