josecebe / twbs-pagination

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

Access to total pages variable #162

Closed psukys closed 6 years ago

psukys commented 6 years ago

As far as I managed to find, there's only a way to retrieve current page through:

.twbsPagination('getCurrentPage');

Is there a way to do this, or should there be an extension like:

.twbsPagination('getTotalPages');
end1an commented 6 years ago

you can implement code to jquery.twbsPagination.min.js by adding some code. Let find getCurrentPage function and insert this code after it.

getTotalPages:function(){return this.options.totalPages}

now you can get total pages by

pagination.twbsPagination('getTotalPages');

josecebe commented 6 years ago

I have implemented this method into 'master', and it will be available in 1.4.2 tag on August 1, 2018.