From d9e02ab5c8a7ef38232d0b3742346b242e7bf262 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Sun, 11 Dec 2011 08:44:28 +0000 Subject: [PATCH] Pull the Ajax functions into their own file --- media/js/jquery.dataTables.js | 365 +++++++++++++++++----------------- media/src/DataTables.js | 1 + media/src/core/core.draw.js | 182 ----------------- 3 files changed, 184 insertions(+), 364 deletions(-) diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 1d20bfe4..d63050cd 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -1523,188 +1523,6 @@ } - /** - * Update the table using an Ajax call - * @param {object} oSettings dataTables settings object - * @returns {boolean} Block the table drawing or not - * @private - */ - function _fnAjaxUpdate( oSettings ) - { - if ( oSettings.bAjaxDataGet ) - { - oSettings.iDraw++; - _fnProcessingDisplay( oSettings, true ); - var iColumns = oSettings.aoColumns.length; - var aoData = _fnAjaxParameters( oSettings ); - _fnServerParams( oSettings, aoData ); - - oSettings.fnServerData.call( oSettings.oInstance, oSettings.sAjaxSource, aoData, - function(json) { - _fnAjaxUpdateDraw( oSettings, json ); - }, oSettings ); - return false; - } - else - { - return true; - } - } - - - /** - * Build up the parameters in an object needed for a server-side processing request - * @param {object} oSettings dataTables settings object - * @returns {bool} block the table drawing or not - * @private - */ - function _fnAjaxParameters( oSettings ) - { - var iColumns = oSettings.aoColumns.length; - var aoData = [], mDataProp; - var i; - - aoData.push( { "name": "sEcho", "value": oSettings.iDraw } ); - aoData.push( { "name": "iColumns", "value": iColumns } ); - aoData.push( { "name": "sColumns", "value": _fnColumnOrdering(oSettings) } ); - aoData.push( { "name": "iDisplayStart", "value": oSettings._iDisplayStart } ); - aoData.push( { "name": "iDisplayLength", "value": oSettings.oFeatures.bPaginate !== false ? - oSettings._iDisplayLength : -1 } ); - - for ( i=0 ; i