AdminLTE3 Data table 用的是jQuery的DataTables插件,功能强大,配置也很方便。
参考地址:https://datatables.net/
DataTables is a plug-in for the jQuery Javascript library. It is a highly flexible tool, built upon the foundations of progressive enhancement, that adds all of these advanced features to any HTML table.
按照目前需要,我修改了一点lauguage部分的配置,从英文改成中文。还有就是默认的排序。
更多需求,可以参考DataTables网站,有详细的例子和说明。
$(function () {
$('#example1').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": true,
"autoWidth": false,
"order" : [[2, 'desc']],
"language": {
"lengthMenu": " _MENU_ 条记录/每页",
"zeroRecords": "对不起,暂时没有记录",
"info": "第 _PAGE_页,共_PAGES_页",
"infoEmpty": "暂无信息",
"infoFiltered": "(从_MAX_条数据中筛选)",
"paginate": {
"previous":"上一页",
"next" : "下一页"
}
}
});
});