josecebe / twbs-pagination

jQuery pagination plugin (bootstrap powered)
http://josecebe.github.io/twbs-pagination/
Other
1.1k stars 401 forks source link

Refresh option #120

Closed wilariz closed 7 years ago

wilariz commented 8 years ago

Hello. I'm using the plugin and I have a feature of my web, the totalPages are dinamic, always incremental way, when change the totalPages I call to initialice the plugin but it never change, just kept the paginator initial with totalPages initial. Is there any way to refresh the paginator changing the totalPages? Thanks for your help. Greetings

frozonfreak commented 8 years ago

+1

shokri-navid commented 8 years ago

+1

shokri-navid commented 8 years ago

i found solution in this SOF Link. in my case second solution worked as a charm :)

bajian commented 8 years ago
//refreshPagination
var refreshPagination = function(totalPages, visiblePages, clickCB) {
    $('#pagination').empty().removeData("twbs-pagination").unbind("page").twbsPagination({
        totalPages: totalPages,
        visiblePages: visiblePages,
        onPageClick: clickCB
    });
}
//usage
// refreshPagination(15,5,function(event, page){
//  alert(page);
// });
moxiaozhou commented 8 years ago

+1

zhangbobell commented 8 years ago

Oh, you could try #66 , maybe it's a good idea.

eugenesimakin commented 7 years ago

Example added. See docs on github.io