I am using Datatables (http://www.datatables.net) at one of my projects. The datatable opens in a Bootstrap Modal and I set the option that only 5 rows are visible on one page. That is working as it should.
Now I wanted to hide the dropdown box for display records and therefore I found the solution on this thread: StackoverFlow - Solution for hiding "Display Records"
My code looks like this now:
$(document).ready(function() {
$('#readnews').dataTable({
"iDisplayLength": 5,
"bPaginate": false,
"bLengthChange": false,
"bFilter": true,
"bInfo": false,
"bAutoWidth": false });
My Problem is now that this code is not working! If I use this code:
$(document).ready(function() {
$('#readnews').dataTable({
"iDisplayLength": 5 });
I can only see 5 rows at a page that is good. If I use this code:
$(document).ready(function() {
$('#readnews').dataTable({
"bPaginate": false,
"bLengthChange": false,
"bFilter": true,
"bInfo": false,
"bAutoWidth": false });
});
I can see that the "Display Records" is hidden but I am not able to use both options (hide "Display Records" and only show 5 recors per page) at once.
Can someone tell me what I am doing wrong? What should my code look like? I do not know what I am doing wrong.
Thanks in advance, Chris