"error": handleAjaxError
table.fnProcessingIndicator( false );
"fnServerData": function ( sSource, aoData, fnCallback ) {
$.ajax( {
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback,
"timeout": 15000, // optional if you want to handle timeouts (which you should)
"error": handleAjaxError // this sets up jQuery to give me errors
} );
},
function handleAjaxError( xhr, textStatus, error ) {
if ( textStatus === 'timeout' ) {
alert( 'The server took too long to send the data.' );
}
else {
alert( 'An error occurred on the server. Please try again in a minute.' );
}
myDataTable.fnProcessingIndicator( false );
}
jQuery.fn.dataTableExt.oApi.fnProcessingIndicator = function ( oSettings, onoff ) {
if ( typeof( onoff ) == 'undefined' ) {
onoff = true;
}
this.oApi._fnProcessingDisplay( oSettings, onoff );
};
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.