From 6dff9570f77d8d7492c718a1a81328901b33cd32 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Mon, 20 Aug 2012 07:58:38 +0100 Subject: [PATCH] Update for fnReloadAjax to have it work, inthe most basic sense, with server-side processing --- api/fnReloadAjax.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/api/fnReloadAjax.js b/api/fnReloadAjax.js index 60f7143..7a237f3 100644 --- a/api/fnReloadAjax.js +++ b/api/fnReloadAjax.js @@ -3,8 +3,6 @@ * time, however it can be useful to re-read an Ajax source and have the table * update. Typically you would need to use the fnClearTable() and fnAddData() * functions, however this wraps it all up in a single function call. - * Note:To reload data when using server-side processing, just use the - * built-inAPI function fnDraw rather than this plug-in. * @name fnReloadAjax * @anchor fnReloadAjax * @author Allan Jardine @@ -19,10 +17,16 @@ $.fn.dataTableExt.oApi.fnReloadAjax = function ( oSettings, sNewSource, fnCallback, bStandingRedraw ) { - if ( typeof sNewSource != 'undefined' && sNewSource != null ) - { + 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;