Multiple Ajax calls

Multiple Ajax calls

eemeem Posts: 2Questions: 0Answers: 0
edited November 2013 in General
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 ?

Replies

  • allanallan Posts: 61,920Questions: 1Answers: 10,152 Site admin
    Currently no - each Ajax request that is made is unique to the host table. There is no way for tables to share requests at this time. Sorry.

    Allan
  • eemeem Posts: 2Questions: 0Answers: 0
    Sorry, I don't want to share AJAX requests.

    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.
This discussion has been closed.