为什么jquery datatable
(见下面的代码)中的行数没有设置为 5?默认情况下等于 10 8as)。为什么'iDisplayLength': 5
在这里不起作用?
<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>