Hi, how can I defer the data loading, after the datable drawing?
Hi, how can I defer the data loading, after the datable drawing?
ElChonchon
Posts: 2Questions: 0Answers: 0
I use Datatables with an Ajax request, that needs 2-3 seconds to retreive the data. During that time, my HTML page looks really ugly, as Datatables aren't not drawn... or sort of...
I would like, on HTML page loading, to:
1- draw all datatables (3 of them on my HTML page), with headers, toolbars, search, etc... and no rows yet. This should be done very fast, right?
2- then call the AJAX data retreival, meanwhile the 'Processing...' div should be displayed
3- and finally, on AJAX request response, add the data rows in the tables.
I have not been able to find any datatable option to achieve this...
I found iDeferLoading but I'm not sure to understand how it works... and I do not know how many rows my table will contain once data retreival is done.
I would like, on HTML page loading, to:
1- draw all datatables (3 of them on my HTML page), with headers, toolbars, search, etc... and no rows yet. This should be done very fast, right?
2- then call the AJAX data retreival, meanwhile the 'Processing...' div should be displayed
3- and finally, on AJAX request response, add the data rows in the tables.
I have not been able to find any datatable option to achieve this...
I found iDeferLoading but I'm not sure to understand how it works... and I do not know how many rows my table will contain once data retreival is done.
This discussion has been closed.
Replies
[code]
oHistoFluxTable = $('#histoflux_table').dataTable( {
"sDom": '<"H"<"toolbarFlux">fr>t<"F"i>',
"sScrollX": "100%",
"sScrollY": "200px",
"bJQueryUI": true,
"bPaginate": false,
"aaSorting": [[0,'asc']],
"bServerSide": false,
"bProcessing": true,
"bAutoWidth": false,
"bDeferRender": true,
"sAjaxSource": "getData.asp"
} );
[/code]
DataTables should be doing the 1, 2, 3 steps you have above - can you link to your page so I can see what is going on please?
Thanks,
Allan