The Bootstrap Tables "Multiple Sort" plugin ("Multiple Sort"), specifically the showMultiSort
feature, is currently not functioning properly with Bootstrap 4. The demonstration available on the linked page shows visible issues.
While the button associated with the plugin is present in the Document Object Model (DOM), it does not display correctly to the end user.
$(function() {
$('#table').bootstrapTable({
data: getData(),
search: true,
showColumns: true,
showMultiSort: true,
sortPriority: getSortPriority()
})
});
function getSortPriority() {
return [{
"sortName": "github.count.forks",
"sortOrder": "desc"
}, {
"sortName": "github.count.stargazers",
"sortOrder": "desc"
}];
}
function getData() {
return [{
"github": {
"name": "bootstrap-table",
"count": {
"stargazers": 768,
"forks": 183
},
"description": "An extended Bootstrap table with radio, checkbox, sort, pagination, and other added features. (supports twitter bootstrap v2 and v3)"
}
}, {
"github": {
"name": "multiple-select",
"count": {
"stargazers": 365,
"forks": 166
},
"description": "A jQuery plugin to select multiple elements with checkboxes :)"
}
}, {
"github": {
"name": "bootstrap-show-password",
"count": {
"stargazers": 37,
"forks": 13
},
"description": "Show/hide password plugin for twitter bootstrap."
}
}]
}
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fb9994948f888f899a8bd68f9a99979ebbcad5cacfd5c9">[email protected]</a>/dist/bootstrap-table.min.js"></script>
<script src="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5a3835352e292e283b2a772e3b38363f1a6b746b6e7468">[email protected]</a>/dist/extensions/multiple-sort/bootstrap-table-multiple-sort.js"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link href="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="01636e6e7572757360712c7560636d6441302f30352f33">[email protected]</a>/dist/bootstrap-table.min.css" rel="stylesheet">
<table id="table">
<thead>
<tr>
<th data-field="github.name" data-sortable="true">Name</th>
<th data-field="github.count.stargazers" data-sortable="true">Stargazers</th>
<th data-field="github.count.forks" data-sortable="true">Forks</th>
<th data-field="github.description" data-sortable="true">Description</th>
</tr>
</thead>
</table>