我正在尝试使用多选复选框下拉列表来过滤或搜索jquery数据表中的列.例如,如果它是城市列,则表格应该过滤或搜索我是否按照复选框下拉菜单检查两个引用,并在下拉列表中显示已检查引用的结果.我尝试了很多方法来寻找解决方案但是,我现在无法破解它.如果有人可以帮助解决这个问题,我们非常感谢.提前致谢.我只是将jquery代码放在下面供您参考.
<head>
<meta charset="utf-8">
<title>jQuery Datatable</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="http://davidstutz.github.io/bootstrap-multiselect/dist/css/bootstrap-multiselect.css">
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> -->
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
<script src="http://davidstutz.github.io/bootstrap-multiselect/dist/js/bootstrap-multiselect.js"></script>
<style>
* {
margin:0;
padding: 0;
}
#wrap {
width: 100%;
margin: auto;
}
.addcolr {
color: green;
}
</style>
<script>
/*$(document).ready(function() {
$('#example th').each(function() {
alert(this.textContent);
});
});*/
$(document).ready(function() {
$('#example').DataTable({ …Run Code Online (Sandbox Code Playgroud)