I am working on a travel portal and use the DataTables JS plugin to populate the results.
"search.results" is an array of JSON objects, each of which contains search results. However, only the first 30 are filled, and the rest are not.
Consoledoes not register any errors, and all search objects appear when you enter the console from the "for" loop.
I need all the results to be populated in the table.
Please help, thanks in advance.
**datatable declaration**
var oTable = $('#search').DataTable({
"bDestroy": true,
"aaSorting": [[4, 'asc']],
"bPaginate": true,
"bInfo": false,
"bFilter": true,
"bScrollCollapse": true,
"fnInitComplete": function() {
this.fnAdjustColumnSizing(true);
}
});
**results population**
for(var j=0; j<search.results.length; j++){
oTable.row.add([
search.results[j].airline,
search.results[j].from,
search.results[j].to,
search.results[j].duration,
search.results[j].fare,
'<button id="button-'+j+'" class="btn btn-change1 book_btn" type="button">book</button>',
]).draw();
};
source
share