fnReloadAjax() running twice and first are wrong information

fnReloadAjax() running twice and first are wrong information

satusetasatuseta Posts: 2Questions: 0Answers: 0
edited May 2012 in DataTables 1.9
Hello,
I have problem with fnReloadAjax() operations. I have this kind of code.
[code]
$.fn.dataTableExt.oApi.fnReloadAjax = function ( oSettings, sNewSource, fnCallback, bStandingRedraw )
{
if ( typeof sNewSource != 'undefined' && sNewSource != null )
{
oSettings.sAjaxSource = sNewSource;
}
this.oApi._fnProcessingDisplay( oSettings, true );
var that = this;
var iStart = oSettings._iDisplayStart;
var aData = [];

this.oApi._fnServerParams( oSettings, aData );

oSettings.fnServerData( oSettings.sAjaxSource, aData, function(json) {
/* Clear the old information from the table */
that.oApi._fnClearTable( oSettings );

/* Got the data - add it to the table */
var aData = (oSettings.sAjaxDataProp !== "") ?
that.oApi._fnGetObjectDataFn( oSettings.sAjaxDataProp )( json ) : json;

for ( var i=0 ; i

Replies

  • satusetasatuseta Posts: 2Questions: 0Answers: 0
    Any help for this problem?
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    As the documentation for fnReloadAjax notes:

    > Note: To reload data when using server-side processing, just use the built-in API function fnDraw rather than this plug-in.

    You are using server-side processing:

    > "bServerSide": true

    so don't use fnReloadAjax :-). Just call fnDraw - fnReloadAjax is effectively useless with server-side processing.

    Allan
This discussion has been closed.