Cambia el número de filas mostradas en jQuery con datos
¿Por qué el número de filas enjquery datatable
(ver el código de abajo) no está configurado a 5? Es igual a 10 8as por defecto). Por qué'iDisplayLength': 5
no funciona aqui?
<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>