Arasu Arasu - 4 years ago 104
Javascript Question

How to Call a javascript function after SAjaxsource completes in JQuery Datatables

I'm using JQuery SAjaxsource How can i Call a javascript function after SAjaxsource completes. I want to update a div after the completion of the datatable load.Please help me...


$(document).ready( function() {
var oTable = $('#example').dataTable( {

"bServerSide": true,
"aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
"bPaginate": true,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sAjaxSource": "server_processingCDB1.php"
} );

Answer Source also works for this, and saved you needing to override fnServerData.

Parameter: fnDrawCallback

Type: function

Inputs: {object}: DataTables settings object

This function is called on every 'draw' event, and allows you to dynamically modify any aspect you want about the created DOM.

$(document).ready( function() {
  $('#example').dataTable( {
    "fnDrawCallback": function( oSettings ) {
      alert( 'DataTables has redrawn the table' );
  } );
} );
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download