How to set the default number of rows displayed
How to set the default number of rows displayed
peterbrowne
Posts: 314Questions: 54Answers: 0
I have tried using "pageLength": 50,
to set the fault number of records displayed in a datatables page, but it's not working. The page only displays 5 records per pagination. Any ideas?
var table = $( '#program_table' ).DataTable( {
responsive: true,
"pageLength": 50,
columnDefs: [ {
targets: [1],
render: $.fn.dataTable.render.ellipsis( 100, true )
} ],
ajax: "program_data/program_data.php",
dom: "Bfrtip",
columns: [ {
data: "program_name"
}, {
data: "program_details"
}, {
data: "modified"
}, {
data: "modified_by"
} ],
select: {
style: 'os',
selector: 'td:first-child'
},
buttons: []
} );
Answers
Mmm, seems to be working now...
That's certainly the way to do it. Possibly you had state saving enabled or the browser was caching an old file.
Allan