$(document).ready(function() {
oTable = $('#table1').dataTable({
"bFilter": true,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "some_url.php",
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( { "name": "something" } );
$.getJSON( sSource, aoData, function (json) {
fnCallback(json)
} );
}
}).ajaxComplete(function(){
// Something1
});
oTable2 = $('#table2').dataTable({
"bFilter": true,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "some_url2.php",
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( { "name": "something2" } );
$.getJSON( sSource, aoData, function (json) {
fnCallback(json)
} );
}
}).ajaxComplete(function(){
// Something2
})
});
$('.dataTable:eq(0)').dataTable();
$('.dataTable:eq(1)').dataTable();
$('.dataTable:eq(2)').dataTable();
This is similar to what you've got, although no initialisation information, and not using server-side processing - although those functions should be wrapped up so tight that the scope isn't going to jump to something unexpected.It looks like you're new here. If you want to get involved, click one of these buttons!
Get useful and friendly help straight from the source.