jQuery Datatables分页设置

编程入门 行业动态 更新时间:2024-10-24 20:14:19
本文介绍了jQuery Datatables分页设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用jquery数据表的分页。我用ajax加载数据。我的回答是:

I'm trying to work with the pagination of the jquery datatables. I load the data with ajax. My response is now:

aaData: [[:anonymous:, null, 2012-07-29 08:28:21, 0, 85 million, null],…] iTotalDisplayRecords: 70 iTotalRecords: 70 sEcho: 1

我的所有记录(70)都显示,我如何让他们分页,每页10个记录?

All of my records (70) are shown, how can I make them paginate and have for ex 10 records per page?

我尝试将iTotalDisplayRecords设置为10,但显示相同的结果。

I tried settings iTotalDisplayRecords to 10 but it shows the same result.

我的datatable init:

My datatable init:

myDataTable = $('#datatablesresults').dataTable({ bProcessing : true, sProcessing : true, bServerSide : true, sAjaxSource : '/results/load-results?' + getParams, aoColumnDefs : [{'bSortable' : false, 'aTargets' : ['no-sort']}], // make the actions column unsortable sPaginationType : 'full_numbers', fnDrawCallback : function(oSettings) { _initTable(); } });

推荐答案

尝试这个: / p>

try this:

$("#myDataTable").dataTables({ "bJQueryUI":true, "bSort":false, "bPaginate":true, "sPaginationType":"full_numbers", "iDisplayLength": 10 });

更多推荐

jQuery Datatables分页设置

本文发布于:2023-11-02 08:27:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551893.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:分页   jQuery   Datatables

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!