Closed mansoor-omrani closed 6 years ago
You can do this with the new method 'changeTotalPages':
$('#myPager').twbsPagination('changeTotalPages', 30, 1);
Where 30 is the new totalPages value and 1 is the new selected page.
At the moment this method is available in 'master', and soon it will be at 1.4.2 tag. (August 1, 2018).
Hi
It seems you need to destroy the pager and create a new instance whenever you want to set current page.
I think setting current page is just a matter of switching class='active' among anchor elements on page numbers.
Wouldn't it better to provide a method for the pager to satisfy this need? Something like below:
$('#myPager').twbsPagination('goto', 5);
This can be extended and more api methods could be provided for the pager.