Ashish Verma
Ashish Verma

Reputation: 942

Bootstrap-Table 1.15.4 pagination number of rows per page drop-down is not working

Bootstrap-Table bootstrap-table.min.js 1.15.4 Bootstrap bootstrap.min.js 4.3.1 Jquery jquery-min.js 3.4.1

Page is loading just fine. However, the drop-down list to select number of rows per page is not working. Table code is working fine on online editor of bootstrap-table. I've already tried using different tables and its not working.

https://jsfiddle.net/ashishvermapu/f54jweyc/1/

<table class="table table-striped" data-pagination="true" data-toggle="table" data-search="true">
<script src="webjars/jquery/3.4.1/jquery.min.js"></script>
<script src="webjars/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="webjars/bootstrap-table/1.15.4/dist/bootstrap-table.min.js"></script>

Upvotes: 1

Views: 1796

Answers (2)

Ashish Verma
Ashish Verma

Reputation: 942

Bootstrap 4 has a dependency on popper.js. I imported following js to fix the problem.

<script src="webjars/popper.js/1.14.7/umd/popper.min.js"></script>

Upvotes: 1

alesssz
alesssz

Reputation: 520

You just need to initialzate the datatable via jquery...give the table an id (i used userDataTable) and use this code

$(document).ready(function() {
    $('#userDataTable').DataTable();
} );

Upvotes: 0

Related Questions