jQuery Datatables分页设置

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

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

显示了我的所有记录(70),如何使它们成为分页并且每页有10个记录?

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

我的数据表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(); } }); 

试试这个:

 $("#myDataTable").dataTables({ "bJQueryUI":true, "bSort":false, "bPaginate":true, "sPaginationType":"full_numbers", "iDisplayLength": 10 }); 
 $('#example').dataTable( { "pagingType": "full_numbers" } ); DataTables has six built-in paging button arrangements: numbers - Page number buttons only (1.10.8) simple - 'Previous' and 'Next' buttons only simple_numbers - 'Previous' and 'Next' buttons, plus page numbers full - 'First', 'Previous', 'Next' and 'Last' buttons full_numbers - 'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers first_last_numbers - 'First' and 'Last' buttons, plus page numbers