在Datatable中的pageLength

时间:2016-11-11 13:43:10

标签: jquery datatable

我尝试将Datatable的pageLength设置为6,但它并没有显示6个计数。见附图enter image description here

$('#tblProviders').dataTable({
    "autoWidth": false,
    "searching": false,
    "pageLength": 6,
    "bDestroy": true,
    data: data,
    columns: [
               { "data": "ProviderName" },
               { "data": "ProviderQualificationTime" },
               { "data": "TotalServiceableOffers" }
    ]
});

1 个答案:

答案 0 :(得分:1)

在代码中添加lengthMenu

"lengthMenu": [
         [6,10, 20, 50, 100, 150, -1],
         [6,10, 20, 50, 100, 150, "All"] // change per page values here
 ],