Closed akaadir closed 6 years ago
Try this.
function create_intialize(){
$('.my-pagination').twbsPagination('destroy')
var twb_options = {
first: '<<',
last: '>>',
next: '>',
prev: '<',
totalPages: $('.total_p').val(),
hideOnlyOnePage: true,
visiblePages: 5,
startPage: parseInt($('.current_p').val()),
initiateStartPageClick: false,
onPageClick: function(event, page) {
//Event
}
}
// ================================>
$('.my-pagination',table).twbsPagination(twb_options);
}
We can close this issue, now is not necessary to destroy the element because there is a new method to update 'totalPages' and 'currentPage'.
Take a look to 'changeTotalPages' method (will be available in 1.4.2 tag, but you can test it in master).
Hi @esimakin,
Can you plz help me fix this issue.
onPageClick event never fires after i destroy and initialize new options like totalpages, Below is my code.
Hope you did understand me :) Thanks!