基于Datatables跳转到指定页的简单实例

2022-01-11,,,,

下面小编就为大家带来一篇基于Datatables跳转到指定页的简单实例。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧

因为项目用到Datatables发现在分页特别多时无法跳转到指定页,自己动手增加了#Datatables 跳转到指定页#功能,实现代码如下:

 table = $('#user-table').dataTable({ "bAutoWidth": false, "processing": true, "serverSide": true, "bStateSave":true, "pagingType": "full_numbers", "order": [[0, 'asc']], "ajax": get_users, "oLanguage": { "sUrl": "/js/advanced-datatable/lang/Chinese.json" }, "drawCallback": function( settings ) { if ($('body').height()  1) { $("#dynamic-table_info").append('跳到  页'); } }, "initComplete": function(settings, json) { if ($('body').height()  0) { table.api().page(page - 1).draw(false); } });

以上这篇基于Datatables跳转到指定页的简单实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持本站。

以上就是基于Datatables跳转到指定页的简单实例的详细内容,更多请关注本站其它相关文章!

《基于Datatables跳转到指定页的简单实例.doc》

下载本文的Word格式文档,以方便收藏与打印。