Call fnDraw synchronously
Call fnDraw synchronously
adeelcap15
Posts: 4Questions: 0Answers: 0
hi allan,
I have following problem.
I am sending an ajax request (to server), and in response, i am refreshing the datatable using fnDraw. It was working fine until
I have a requirement to show a PDF. so after getting response from my ajax request, I am now refreshing the datatable and than
submiting a form to display a PDF.
Due to form submission, the fnDraw ajax request aborted, is there any way so that I call fnDraw method synchronously, and than POST the form.
Thanks
I have following problem.
I am sending an ajax request (to server), and in response, i am refreshing the datatable using fnDraw. It was working fine until
I have a requirement to show a PDF. so after getting response from my ajax request, I am now refreshing the datatable and than
submiting a form to display a PDF.
Due to form submission, the fnDraw ajax request aborted, is there any way so that I call fnDraw method synchronously, and than POST the form.
Thanks
This discussion has been closed.
Replies
[code]
$(document).ready( function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "xhr.php",
"fnServerData": function ( sSource, aoData, fnCallback, oSettings ) {
oSettings.jqXHR = $.ajax( {
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"async": false,
"success": fnCallback
} );
}
} );
} );
[/code]
Allan