问题
标准的dataTable页面翻页功能仅可以实现跳转至某一页,上一页,下一页功能;
因客户需求需实现跳转至首页及尾页功能。
解决办法
- 在头文件引入以下js
<script src="//cdn.datatables.net/plug-ins/1.10.19/pagination/four_button.js"></script>
- 修改dataTable参数,将以下代码添加到如图位置
"sPaginationType": "four_button",//跳转首页尾页
实现效果
可以实现首页尾页,上一页下一页功能
插件代码
The built-in pagination functions provide either two buttons (forward / back) or lots of buttons (forward, back, first, last and in