How to change number of rows per page in jquery
How to change number of rows per page in jquery
I have a table that is built from HTML, and called via:
$(document)
.ready(function () {
$('#peopleindex').dataTable({
"autoWidth": false,
"lengthChange": false,
"pageLength": 25
});
});
I want to be able to set the number of rows per page based on screen height.
Can this be done via CSS or thru java? If thru java, how do I change the number of rows and refresh the table? I can get to the point of checking the screen size and calculating how many rows I want, I just am not sure how to actually change the value in dataTables and then refresh.
Thanks,
Keith
This question has an accepted answers - jump to answer
Answers
I think you mean Javascript rather than Java!
Yes it is possible with this plug-in that I wrote a while back: https://github.com/DataTables/Plugins/tree/master/features/pageResize .
I wrote a blog post about it as well.
Allan