jquery-bootpag
jquery-bootpag copied to clipboard
How I can destroy or refresh component?
How I can destroy or refresh component?
I need refresh pagination component with new total parameter after ajax. How I can do this?
it would be great if you can add a call to destroy api.
I am using this with ajax pagination at below. It allows you query the results with AJAX call. So if no result, I need to unbind its events. Because otherwise, it later multiples calls on pagination links.
if($('#tbody').children('tr').length) {
if($('ul.bootpag').length) {
$('#pagination-wrapper').bootpag({total: rData.total_pages, maxVisible:10});
} else {
$('#pagination-wrapper').bootpag({
total: rData.total_pages,
maxVisible: 10,
page: qS.p,
}).on("page", function(event, num){
qS.p = num;
history.pushState(qS, null, EYS.URI.getUriString() + '?' + $.param(qS));
EYS.XHR.call('module/users/xhr_table_data', qS, null, dump_rows);
$(this).bootpag({total: rData.total_pages, maxVisible:10});
});
}
} else {
$('#pagination-wrapper').empty();
}
@yahyaerturan You can use off("page") to unbind event