H.Sdq
H.Sdq

Reputation: 857

how to remove 'first','previous','next' and 'last' buttons from twbs pagination plugin

I need a simple pagination showing just page numbers without its control buttons (first,previous,next and last), I reviewed twbs options in twbs-pagination github docs and also stackoverflow but unfortunately found nothing! Is removing control buttons possible in this plugin? If not could you introduce a pagination plugin which can be used with dynamic data (via ajax call)? Your help is appreciated in advance.

Upvotes: 1

Views: 3038

Answers (1)

Serge Andreev
Serge Andreev

Reputation: 310

Please set the first, prev, next, last variables to '' (null value). See example:

$('#pagination-demo').twbsPagination({
        totalPages: 35,
        visiblePages: 7,
        first: '',
        prev: '',
        next: '',
        last: '',
        onPageClick: function (event, page) {
            $('#page-content').text('Page ' + page);
        }
    });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://esimakin.github.io/twbs-pagination/js/jquery.twbsPagination.js" type="text/javascript"></script>

 <div id="page-content">Page </div>
 <ul id="pagination-demo" class="pagination-sm"></ul>
 

Upvotes: 5

Related Questions