Display "Loading..." in table when using fnReloadAjax()

Display "Loading..." in table when using fnReloadAjax()

billpullbillpull Posts: 11Questions: 0Answers: 0
edited January 2013 in General
I am using DataTables with the Bootstrap theme loading data via sAjaxSource. I like how when I load the
page I get 1 row that displays "Loading..." but I have a couple filters that reload the data source via the
fnReloadAjax plugin() and there is no progress indicator. Setting bProcessing to true and setting "r" in the
sDom doesnt give me the same message either or replace the current data. Any way to do this.

[code]
$.fn.dataTableExt.oApi.fnReloadAjax = function ( oSettings, sNewSource, fnCallback, bStandingRedraw )
{
if ( typeof sNewSource != 'undefined' && sNewSource != null ) {
oSettings.sAjaxSource = sNewSource;
}

// Server-side processing should just call fnDraw
if ( oSettings.oFeatures.bServerSide ) {
this.fnDraw();
return;
}

this.oApi._fnProcessingDisplay( oSettings, true );
var that = this;
var iStart = oSettings._iDisplayStart;
var aData = [];

this.oApi._fnServerParams( oSettings, aData );

oSettings.fnServerData.call( oSettings.oInstance, 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

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Looks like it should work to me. As you can see, the plug-in calls `_fnProcessingDisplay` . I think you'll likely need to add some debugging code to the script to check that everything is being called correctly.

    Allan
  • billpullbillpull Posts: 11Questions: 0Answers: 0
    edited January 2013
    Oh looks like that plugin sets it to false setting it to true displays the processing.... text. I still am not sure how to mimic the "loading..." row of the initial data load. Is it possible to disable that and just show the processing...
  • billpullbillpull Posts: 11Questions: 0Answers: 0
    is there a method that inputs the sLoadingRecords text into the table. In my case I would like to call that instead of _fnProcessingDisplay()
This discussion has been closed.