我正在使用数据表& JSP页面中的Bootstrap
https://datatables.net/manual/styling/bootstrap-simple.html
我想在选择器中添加 onchange 功能 显示N个条目
这可能吗???????????
这是我的JSP中的代码:
<script>
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
var table = $('#deviceTableId').DataTable({
"dom": '<"top">rt<"bottom"lp><"clear">',
"autoWidth": false,
"columnDefs": [
{"targets": 'nosort', "orderable": false, "width": '30%'},
{"targets": [0], "width": '20%'},
{"targets": [1], "width": '35%'},
{"targets": [2], "width": '15%'},
]
});
table.columns().every( function () {
var that = this;
$( 'input', this.header() ).on( 'keyup change', function () {
if ( that.search() !== this.value ) {
that
.search( this.value )
.draw();
}
} );
} );
});
</script
&GT;