zaria khan
zaria khan

Reputation: 333

pageLength in Datatable

I tried to set the pageLength of Datatable to 6 but it doesn't show 6 in count. See attached pictureenter image description here

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

Upvotes: 3

Views: 229

Answers (1)

Mubin
Mubin

Reputation: 92

Add lengthMenu in your code

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

Upvotes: 1

Related Questions