Monday, January 5, 2015

Paging with Simple Pagination in Liferay

Reference: http://flaviusmatis.github.io/simplePagination.js/

In Liferay,

function renderPaginator(total, url, currentPage) {
    if(total > 0) {
        $(function() {
            $('#paginator').pagination({
                items: total,
                itemsOnPage: 20,
                cssStyle: 'light-theme',
                currentPage:currentPage,
                onPageClick : function(page) {
                    //update page
                }
            });
        });
        $('#page-no-result').html("");
 

    } else {
        $('#paginator').html("");
        $('#page-no-result').html(Liferay.Language.get("content.noresult"));
    }
}

No comments:

Post a Comment