Closed pavelthq closed 7 years ago
getCurrentPage is also would be helpfull in #61
once the twbsPagination has been called on the page, is it possible to call it again, with different values for the totalPages and such? I am trying to use it within a page where I'm doing a search via AJAX, and based on the number of records that are in the result set, I need to update the pager. It's not working by calling twbsPagination on the jQuery element again
Yes it is possible. You need to destroy call before new initialization.
Thanks, please provide example of using destroy().
$('#pagination').twbsPagination('destroy');
And then use initialization as usual.
Experiencing the same problem, glad to see this, really helped! Another question here is how to check if the object is a TwbsPagination instance?
You can check by class for example. Or if pagination is initialized you can use jQuery(youelememt).data('twbsPagination')
Referers to: #59 Would be nice if we have a methods to get data about current state.
Examples:
some of them can be combined to one, for example isAllowed('next'), isAllowed('prev').. or show('next')/ show('+1'), show('first') / show(0)?