Multiple Ajax calls
Multiple Ajax calls
Hello,
I have a HTML page with 7 tables. All tables are filled with an async AJAX request. The problem is, for some reason, some tables don't have any data (they are waiting for an AJAX response).
My JS script looks like :
[code]
$('#table_1').dataTable({
"bProcessing" : true,
"bServerSide" : false,
"bDeferRender" : true,
"sServerMethod" : "POST",
"sAjaxSource" : sURLData,
"fnServerParams" : function ( aoData ) {
aoData.push( { "name": "myname", "value": "myvalue" } );
},
"fnRowCallback" : function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
//something
return nRow;
}
});
$('#table_2').dataTable({
"bProcessing" : true,
"bServerSide" : false,
"bDeferRender" : true,
"sServerMethod" : "POST",
"sAjaxSource" : sURLData,
"fnServerParams" : function ( aoData ) {
aoData.push( { "name": "myname", "value": "myvalue" } );
},
"fnRowCallback" : function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
//something
return nRow;
}
});
// Same for table 3, 4, ...7
[/code]
Is there a way to synchronize AJAX calls to fill all tables with 7 AJAX requests ?
I have a HTML page with 7 tables. All tables are filled with an async AJAX request. The problem is, for some reason, some tables don't have any data (they are waiting for an AJAX response).
My JS script looks like :
[code]
$('#table_1').dataTable({
"bProcessing" : true,
"bServerSide" : false,
"bDeferRender" : true,
"sServerMethod" : "POST",
"sAjaxSource" : sURLData,
"fnServerParams" : function ( aoData ) {
aoData.push( { "name": "myname", "value": "myvalue" } );
},
"fnRowCallback" : function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
//something
return nRow;
}
});
$('#table_2').dataTable({
"bProcessing" : true,
"bServerSide" : false,
"bDeferRender" : true,
"sServerMethod" : "POST",
"sAjaxSource" : sURLData,
"fnServerParams" : function ( aoData ) {
aoData.push( { "name": "myname", "value": "myvalue" } );
},
"fnRowCallback" : function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
//something
return nRow;
}
});
// Same for table 3, 4, ...7
[/code]
Is there a way to synchronize AJAX calls to fill all tables with 7 AJAX requests ?
This discussion has been closed.
Replies
Allan
I just want to fire 7 differents AJAX requests (this part is ok). In my example, all 7 requests are sent to the server -at the same time- however only 3 or 4 tables are filled.