dataTables.fnReloadAjax.js - warvox - VoIP based wardialing tool, forked from rapid7/warvox.
 (HTM) git clone git://jay.scot/warvox
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
       ---
       dataTables.fnReloadAjax.js (1516B)
       ---
            1 jQuery.fn.dataTableExt.oApi.fnReloadAjax = function ( oSettings, sNewSource, fnCallback, bStandingRedraw )
            2 {
            3   if ( typeof sNewSource != 'undefined' && sNewSource != null ) {
            4     oSettings.sAjaxSource = sNewSource;
            5   }
            6 
            7   // Server-side processing should just call fnDraw
            8   if ( oSettings.oFeatures.bServerSide ) {
            9     this.fnDraw();
           10     return;
           11   }
           12 
           13   this.oApi._fnProcessingDisplay( oSettings, true );
           14   var that = this;
           15   var iStart = oSettings._iDisplayStart;
           16   var aData = [];
           17 
           18   this.oApi._fnServerParams( oSettings, aData );
           19 
           20   oSettings.fnServerData.call( oSettings.oInstance, oSettings.sAjaxSource, aData, function(json) {
           21     /* Clear the old information from the table */
           22     that.oApi._fnClearTable( oSettings );
           23 
           24     /* Got the data - add it to the table */
           25     var aData =  (oSettings.sAjaxDataProp !== "") ?
           26       that.oApi._fnGetObjectDataFn( oSettings.sAjaxDataProp )( json ) : json;
           27 
           28     for ( var i=0 ; i<aData.length ; i++ )
           29     {
           30       that.oApi._fnAddData( oSettings, aData[i] );
           31     }
           32 
           33     oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
           34 
           35     if ( typeof bStandingRedraw != 'undefined' && bStandingRedraw === true )
           36     {
           37       oSettings._iDisplayStart = iStart;
           38       that.fnDraw( false );
           39     }
           40     else
           41     {
           42       that.fnDraw();
           43     }
           44 
           45     that.oApi._fnProcessingDisplay( oSettings, false );
           46 
           47     /* Callback user function - for event handlers etc */
           48     if ( typeof fnCallback == 'function' && fnCallback != null )
           49     {
           50       fnCallback( oSettings );
           51     }
           52   }, oSettings );
           53 };