Why is the number of rows in jquery datatable (see code below) not set to 5? By default, it is 10 8). Why is 'iDisplayLength': 5 not working here?
<script> function loadData() { $.getJSON( 'modules/getData.php', function(data) { var oTable = $('#newspaper-b').dataTable({ "sPaginationType":"full_numbers", "aaSorting":[[3, "asc"]], "bJQueryUI":true, 'iDisplayLength': 5, 'bLengthChange': false }); oTable.fnDraw(); var list = data.flights; var textToInsert = ''; for (var i = 0; i < list.length; i++) { aux = list[i]; textToInsert += '<tr><td>'; textToInsert += aux.Var1; textToInsert += '</td> </tr>' ; } $('table#newspaper-b tbody').html(textToInsert); } ); } </script>
javascript jquery datatable
You kuper
source share