Created
December 8, 2011 22:46
-
-
Save micmath/1449056 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* File: jquery.dataTables.js | |
* Version: 1.9.0.dev | |
* Description: Paginate, search and sort HTML tables | |
* Author: Allan Jardine (www.sprymedia.co.uk) | |
* Created: 28/3/2008 | |
* Language: Javascript | |
* License: GPL v2 or BSD 3 point style | |
* Project: Mtaala | |
* Contact: [email protected] | |
* | |
* Copyright 2008-2011 Allan Jardine, all rights reserved. | |
* | |
* This source file is free software, under either the GPL v2 license or a | |
* BSD style license, as supplied with this software. | |
* | |
* This source file is distributed in the hope that it will be useful, but | |
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
* or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. | |
* | |
* For details please refer to: http://www.datatables.net | |
*/ | |
/* | |
* When considering jsLint, we need to allow eval() as it it is used for reading cookies | |
*/ | |
/*jslint evil: true, undef: true, browser: true */ | |
/*globals $, jQuery,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnArrayCmp,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnReOrderIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs*/ | |
(/** @lends <global> */function($, window, document) { | |
/** | |
* DataTables is a plug-in for the jQuery Javascript library. It is a | |
* highly flexible tool, based upon the foundations of progressive | |
* enhancement, which will add advanced interaction controls to any | |
* HTML table. For a full list of features please refer to | |
* <a href="http://datatables.net">DataTables.net</a>. | |
* | |
* @class | |
* @param {object} [oInit={}] Configuration object for DataTables. Options | |
* are defined by {@link DataTable.models.oInit} | |
* @requires jQuery 1.3+ | |
* | |
* @example | |
* // Basic initialisation | |
* $(document).ready( function { | |
* $('#example').dataTable(); | |
* } ); | |
* | |
* @example | |
* // Initialisation with configuration options - in this case, disable | |
* // pagination and sorting. | |
* $(document).ready( function { | |
* $('#example').dataTable( { | |
* "bPaginate": false, | |
* "bSort": false | |
* } ); | |
* } ); | |
*/ | |
var DataTable = function( oInit ) | |
{ | |
require('core.columns.js'); | |
require('core.data.js'); | |
require('core.draw.js'); | |
require('core.filter.js'); | |
require('core.info.js'); | |
require('core.init.js'); | |
require('core.length.js'); | |
require('core.page.js'); | |
require('core.processing.js'); | |
require('core.scrolling.js'); | |
require('core.sizing.js'); | |
require('core.sort.js'); | |
require('core.state.js'); | |
require('core.support.js'); | |
require('api.methods.js'); | |
require('api.internal.js'); | |
var _that = this; | |
return this.each(function() { | |
require('core.constructor.js'); | |
} ); | |
}; | |
/** | |
* Version string for plug-ins to check compatibility. Allowed format is | |
* a.b.c.d.e where: a:int, b:int, c:int, d:string(dev|beta), e:int. d and | |
* e are optional | |
* @member | |
* @type string | |
* @default Version number | |
*/ | |
DataTable.version = "1.9.0.dev"; | |
/** | |
* Private data store, containing all of the settings objects that are created for the | |
* tables on a given page. | |
* @member | |
* @type array | |
* @default [] | |
* @private | |
*/ | |
DataTable.settings = []; | |
/** | |
* Object models container, for the various models that DataTables has available | |
* to it. | |
* @namespace | |
*/ | |
DataTable.models = {}; | |
require('model.ext.js'); | |
require('model.search.js'); | |
require('model.row.js'); | |
require('model.column.js'); | |
require('model.init.js'); | |
require('model.settings.js'); | |
/** | |
* Extension object for DataTables that is used to provide all extension options | |
* @namespace | |
*/ | |
DataTable.ext = $.extend( true, {}, DataTable.models.ext ); | |
require('ext.classes.js'); | |
require('ext.paging.js'); | |
require('ext.sorting.js'); | |
require('ext.types.js'); | |
// jQuery aliases | |
$.fn.DataTable = DataTable; | |
$.fn.dataTable = DataTable; | |
$.fn.dataTableSettings = DataTable.settings; | |
$.fn.dataTableExt = DataTable.ext; | |
// Information about events fired by DataTables - for documentation. | |
/** | |
* Draw event, fired whenever the table is redrawn on the page, at the same point as | |
* fnDrawCallback. This may be useful for binding events or performing calculations when | |
* the table is altered at all. | |
* @event DataTable#draw | |
* @param {event} e jQuery event object | |
* @param {object} o DataTables settings object {@link DataTable.models.oSettings} | |
*/ | |
/** | |
* Filter event, fired when the filtering applied to the table (using the build in global | |
* global filter, or column filters) is altered. | |
* @event DataTable#filter | |
* @param {event} e jQuery event object | |
* @param {object} o DataTables settings object {@link DataTable.models.oSettings} | |
*/ | |
/** | |
* Page change event, fired when the paging of the table is altered. | |
* @event DataTable#page | |
* @param {event} e jQuery event object | |
* @param {object} o DataTables settings object {@link DataTable.models.oSettings} | |
*/ | |
/** | |
* Sort event, fired when the sorting applied to the table is altered. | |
* @event DataTable#sort | |
* @param {event} e jQuery event object | |
* @param {object} o DataTables settings object {@link DataTable.models.oSettings} | |
*/ | |
/** | |
* 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, | |
* if you override fnServerData and which to use this event, you need to trigger it in | |
* you success function). | |
* @event DataTable#xhr | |
* @param {event} e jQuery event object | |
* @param {object} o DataTables settings object {@link DataTable.models.oSettings} | |
*/ | |
})(jQuery, window, document); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment