Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Regenerate the paging #48

Open
alxe1528 opened this issue Jul 27, 2015 · 2 comments
Open

Regenerate the paging #48

alxe1528 opened this issue Jul 27, 2015 · 2 comments

Comments

@alxe1528
Copy link

May submit different parameters in single Page, regenerate the paging, to do so, however, display: 2 of Page 1.
Though the window.location.reload(); can solve the problem, but it doesn't have a good experience.
So hope to provide a param or a destroy mothed to regenerate the paging.

Here is my code:
var recordSize=10;
......
$(function(){

var dataCount=doSearch(1,recordSize);
$('.pagination').jqPagination({
    link_string : '/?page={page_number}',
    current_page: 1,
    max_page    : Math.ceil(dataCount/recordSize),// 4,
    //page_string : '当前第{current_page}页,共{max_page}页',
    paged       : function(page) {
        doSearch(page,recordSize);
    }
});
.........
.........
$("input:radio[name=status]").change(function () {
    var dataCount=doSearch(1,recordSize);

    $('.pagination').jqPagination({
        link_string : '/?page={page_number}',
        current_page: 1,
        max_page    : Math.ceil(dataCount/recordSize),// 4,
        //page_string : '当前第{current_page}页,共{max_page}页',
        paged       : function(page) {
            doSearch(page,recordSize);
        }
    });
    //window.location.reload();
});

});

Thank you.

@ajays1991
Copy link

+1.From looking at the date this issue was opened this library is not at all maintained.

@jamsan-n
Copy link

jamsan-n commented Apr 9, 2018

I found one solution like this:
$('.pagination').data('jqPagination').setMaxPage(10);
$('.pagination').data('jqPagination').setPage(1); //this will set current page

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants