From 5a2d4f8782248b3f02dcbbdc065f2e8e0ab30fc7 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Tue, 27 Dec 2011 18:37:28 +0000 Subject: [PATCH] New: Add "processing" event --- media/js/jquery.dataTables.js | 13 +++++++++++++ media/src/DataTables.js | 11 +++++++++++ media/src/core/core.processing.js | 2 ++ 3 files changed, 26 insertions(+) diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index a8a62fd1..2a4f8ce3 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -2869,6 +2869,8 @@ an[i].style.visibility = bShow ? "visible" : "hidden"; } } + + $(oSettings.oInstance).trigger('processing', [oSettings, bShow]); } @@ -11189,6 +11191,17 @@ * @param {object} json The saved infromation from the local cookie */ + /** + * Processing event, fired when DataTables is doing some kind of processing (be it, + * sort, filter or anything else). Can be used to indicate to the end user that + * there is something happening, or that something has finished. + * @name DataTable#processing + * @event + * @param {event} e jQuery event object + * @param {object} oSettings DataTables settings object + * @param {boolean} bShow Flag for if DataTables is doing processing or not + */ + /** * Ajax (XHR) event, fired whenever an Ajax request is completed from a request to * made to the server for new data (note that this trigger is called in fnServerData, diff --git a/media/src/DataTables.js b/media/src/DataTables.js index 472b1d7e..d4d10d58 100644 --- a/media/src/DataTables.js +++ b/media/src/DataTables.js @@ -211,6 +211,17 @@ * @param {object} json The saved infromation from the local cookie */ + /** + * Processing event, fired when DataTables is doing some kind of processing (be it, + * sort, filter or anything else). Can be used to indicate to the end user that + * there is something happening, or that something has finished. + * @name DataTable#processing + * @event + * @param {event} e jQuery event object + * @param {object} oSettings DataTables settings object + * @param {boolean} bShow Flag for if DataTables is doing processing or not + */ + /** * Ajax (XHR) event, fired whenever an Ajax request is completed from a request to * made to the server for new data (note that this trigger is called in fnServerData, diff --git a/media/src/core/core.processing.js b/media/src/core/core.processing.js index f1bdd34c..8d29f6f5 100644 --- a/media/src/core/core.processing.js +++ b/media/src/core/core.processing.js @@ -38,5 +38,7 @@ function _fnProcessingDisplay ( oSettings, bShow ) an[i].style.visibility = bShow ? "visible" : "hidden"; } } + + $(oSettings.oInstance).trigger('processing', [oSettings, bShow]); }