2015-09-07 16:54:09 +02:00
|
|
|
/*! DataTables 1.10.10-dev
|
2015-09-01 10:51:29 +02:00
|
|
|
* ©2008-2015 SpryMedia Ltd - datatables.net/license
|
2013-10-19 20:01:34 +02:00
|
|
|
*/
|
|
|
|
|
2011-12-15 15:05:52 +01:00
|
|
|
/**
|
|
|
|
* @summary DataTables
|
2013-11-12 20:18:40 +01:00
|
|
|
* @description Paginate, search and order HTML tables
|
2015-09-07 16:54:09 +02:00
|
|
|
* @version 1.10.10-dev
|
2011-12-15 15:26:23 +01:00
|
|
|
* @file jquery.dataTables.js
|
2013-12-19 15:01:19 +01:00
|
|
|
* @author SpryMedia Ltd (www.sprymedia.co.uk)
|
2011-12-15 15:05:52 +01:00
|
|
|
* @contact www.sprymedia.co.uk/contact
|
2015-09-01 10:51:29 +02:00
|
|
|
* @copyright Copyright 2008-2015 SpryMedia Ltd.
|
2010-08-17 09:42:13 +02:00
|
|
|
*
|
2013-12-11 18:20:42 +01:00
|
|
|
* This source file is free software, available under the following license:
|
|
|
|
* MIT license - http://datatables.net/license
|
2013-02-05 10:36:58 +01:00
|
|
|
*
|
|
|
|
* This source file is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
2010-08-17 09:42:13 +02:00
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
|
2013-02-05 10:36:58 +01:00
|
|
|
*
|
2010-08-17 09:42:13 +02:00
|
|
|
* For details please refer to: http://www.datatables.net
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*jslint evil: true, undef: true, browser: true */
|
2015-08-25 15:18:30 +02:00
|
|
|
/*globals $,require,jQuery,define,_selector_run,_selector_opts,_selector_first,_selector_row_indexes,_ext,_Api,_api_register,_api_registerPlural,_re_new_lines,_re_html,_re_formatted_numeric,_re_escape_regex,_empty,_intVal,_numToDecimal,_isNumber,_isHtml,_htmlNumeric,_pluck,_pluck_order,_range,_stripHtml,_unique,_fnBuildAjax,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnAjaxDataSrc,_fnAddColumn,_fnColumnOptions,_fnAdjustColumnSizing,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnVisbleColumns,_fnGetColumns,_fnColumnTypes,_fnApplyColumnDefs,_fnHungarianMap,_fnCamelToHungarian,_fnLanguageCompat,_fnBrowserDetect,_fnAddData,_fnAddTr,_fnNodeToDataIndex,_fnNodeToColumnIndex,_fnGetCellData,_fnSetCellData,_fnSplitObjNotation,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnGetDataMaster,_fnClearTable,_fnDeleteIndex,_fnInvalidate,_fnGetRowElements,_fnCreateTr,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAddOptionsHtml,_fnDetectHeader,_fnGetUniqueThs,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnFilterCreateSearch,_fnEscapeRegex,_fnFilterData,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnInfoMacros,_fnInitialise,_fnInitComplete,_fnLengthChange,_fnFeatureHtmlLength,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnFeatureHtmlTable,_fnScrollDraw,_fnApplyToChildren,_fnCalculateColumnWidths,_fnThrottle,_fnConvertToWidth,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnSortFlatten,_fnSort,_fnSortAria,_fnSortListener,_fnSortAttachListener,_fnSortingClasses,_fnSortData,_fnSaveState,_fnLoadState,_fnSettingsFromNode,_fnLog,_fnMap,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnLengthOverflow,_fnRenderer,_fnDataSource,_fnRowAttributes*/
|
2010-08-17 09:42:13 +02:00
|
|
|
|
2014-01-17 09:51:06 +01:00
|
|
|
(/** @lends <global> */function( window, document, undefined ) {
|
2012-09-02 10:49:17 +02:00
|
|
|
|
2012-09-02 11:33:49 +02:00
|
|
|
(function( factory ) {
|
|
|
|
"use strict";
|
|
|
|
|
2014-04-11 10:15:20 +02:00
|
|
|
if ( typeof define === 'function' && define.amd ) {
|
2015-10-13 16:26:36 +02:00
|
|
|
// Define as an AMD module if possible
|
|
|
|
define( 'datatables', ['jquery'], factory );
|
2012-09-02 11:33:49 +02:00
|
|
|
}
|
2015-07-24 12:45:08 +02:00
|
|
|
else if ( typeof exports === 'object' ) {
|
2015-10-13 16:26:36 +02:00
|
|
|
// Node/CommonJS
|
|
|
|
module.exports = factory( require( 'jquery' ) );
|
2015-07-24 12:45:08 +02:00
|
|
|
}
|
2015-10-13 16:26:36 +02:00
|
|
|
else if ( jQuery && !jQuery.fn.dataTable ) {
|
|
|
|
// Define using browser globals otherwise
|
|
|
|
// Prevent multiple instantiations if the script is loaded twice
|
2012-09-02 11:33:49 +02:00
|
|
|
factory( jQuery );
|
|
|
|
}
|
2012-09-02 10:49:17 +02:00
|
|
|
}
|
2012-09-02 11:33:49 +02:00
|
|
|
(/** @lends <global> */function( $ ) {
|
|
|
|
"use strict";
|
New: The primary public interface for DataTables' initialisation options is now camel case parameters rather than the Hungarian notation that was used before. There are a number of reasons for doing this, the primary one being that the Hungarian notation used by DataTables is actively stopping people from using the library due to their aversion to using Hungarian notation. Without doubt the Hungarian notation used was a mistake (the reason it was used was that when DataTables was originally written, the company I worked for at the time required the use of Hungarian notation, and thus I was trained in it...).
Backwards compatibility issues: The main goal here (other than to use camel-case notation!) is to preserve backwards compatibility. Unfortunately this isn't 100% possible:
- DataTable.defaults.columns has been renamed to be DataTable.defaults.column
- Otherwise it conflicts with aoColumns in the defaults.
Without doubt this is going to be a long process - for example the unit tests and examples need to be completely updated for this change. The JSDoc comments have been updated, so the site should take care of itself for the most part, when released.
In terms of implementation, it is important to note that I have not broken backwards compatibility here - the way it is does is that the current defaults are retained, and a camel-case to Hungarian mapping is automatically generated and then applied to the objects given by the end user. This adds around 0.5K to the size of DataTables, but writing the mapping manually would require at least 3K, and changing DataTables wholesale to camel-case would utterly break backwards compatibility. This is the least 'evil' way to accomplish this. It is important to note that this is a step along the roadmap for DataTables - come v2 Hungarian notation will likely be dropped completely.
One important note to make about this mapping is that if you use camel-case DataTables will copy the value from the camel-case properties to their Hungarian counterparts, so you will end up with additional properties on your source object. As I say, this appears to be to be the least 'evil' option, although still not perfect itself. The challenges of working with legacy software and installs...!
2012-10-07 12:50:29 +02:00
|
|
|
|
2013-02-05 10:36:58 +01:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
* [DataTables.net](href="http://datatables.net).
|
2012-10-07 19:13:16 +02:00
|
|
|
*
|
2013-02-05 10:36:58 +01:00
|
|
|
* Note that the `DataTable` object is not a global variable but is aliased
|
|
|
|
* to `jQuery.fn.DataTable` and `jQuery.fn.dataTable` through which it may
|
|
|
|
* be accessed.
|
2012-10-07 19:13:16 +02:00
|
|
|
*
|
|
|
|
* @class
|
2013-02-05 10:36:58 +01:00
|
|
|
* @param {object} [init={}] Configuration object for DataTables. Options
|
2012-10-07 19:13:16 +02:00
|
|
|
* are defined by {@link DataTable.defaults}
|
2014-01-17 17:44:53 +01:00
|
|
|
* @requires jQuery 1.7+
|
2013-02-05 10:36:58 +01:00
|
|
|
*
|
2012-10-07 19:13:16 +02:00
|
|
|
* @example
|
|
|
|
* // Basic initialisation
|
|
|
|
* $(document).ready( function {
|
|
|
|
* $('#example').dataTable();
|
|
|
|
* } );
|
2013-02-05 10:36:58 +01:00
|
|
|
*
|
2012-10-07 19:13:16 +02:00
|
|
|
* @example
|
|
|
|
* // Initialisation with configuration options - in this case, disable
|
|
|
|
* // pagination and sorting.
|
|
|
|
* $(document).ready( function {
|
|
|
|
* $('#example').dataTable( {
|
2013-02-05 10:36:58 +01:00
|
|
|
* "paginate": false,
|
|
|
|
* "sort": false
|
2012-10-07 19:13:16 +02:00
|
|
|
* } );
|
|
|
|
* } );
|
|
|
|
*/
|
|
|
|
var DataTable;
|
|
|
|
|
2015-10-13 16:26:36 +02:00
|
|
|
require('core.internal.js');
|
|
|
|
require('core.compat.js');
|
|
|
|
require('core.columns.js');
|
|
|
|
require('core.data.js');
|
|
|
|
require('core.draw.js');
|
|
|
|
require('core.ajax.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');
|
|
|
|
|
|
|
|
DataTable = function( options )
|
2015-10-06 13:03:36 +02:00
|
|
|
{
|
2015-10-13 16:26:36 +02:00
|
|
|
require('api.legacy.js');
|
|
|
|
|
|
|
|
var _that = this;
|
|
|
|
var emptyInit = options === undefined;
|
|
|
|
var len = this.length;
|
|
|
|
|
|
|
|
if ( emptyInit ) {
|
|
|
|
options = {};
|
2015-10-06 13:03:36 +02:00
|
|
|
}
|
2015-10-13 16:26:36 +02:00
|
|
|
|
|
|
|
this.oApi = this.internal = _ext.internal;
|
|
|
|
|
|
|
|
// Extend with old style plug-in API methods
|
|
|
|
for ( var fn in DataTable.ext.internal ) {
|
|
|
|
if ( fn ) {
|
|
|
|
this[fn] = _fnExternApiFunc(fn);
|
2015-10-06 13:03:36 +02:00
|
|
|
}
|
|
|
|
}
|
2015-10-13 16:26:36 +02:00
|
|
|
|
|
|
|
this.each(function() {
|
|
|
|
// For each initialisation we want to give it a clean initialisation
|
|
|
|
// object that can be bashed around
|
|
|
|
var o = {};
|
|
|
|
var oInit = len > 1 ? // optimisation for single table case
|
|
|
|
_fnExtend( o, options, true ) :
|
|
|
|
options;
|
|
|
|
|
|
|
|
require('core.constructor.js');
|
2015-10-06 13:03:36 +02:00
|
|
|
} );
|
2015-10-13 16:26:36 +02:00
|
|
|
_that = null;
|
2013-05-25 09:21:55 +02:00
|
|
|
return this;
|
2015-10-06 13:03:36 +02:00
|
|
|
};
|
2015-10-13 16:26:36 +02:00
|
|
|
|
|
|
|
require('api.base.js');
|
|
|
|
require('api.table.js');
|
|
|
|
require('api.draw.js');
|
|
|
|
require('api.page.js');
|
|
|
|
require('api.ajax.js');
|
|
|
|
require('api.selectors.js');
|
|
|
|
require('api.rows.js');
|
|
|
|
require('api.row.details.js');
|
|
|
|
require('api.columns.js');
|
|
|
|
require('api.cells.js');
|
|
|
|
require('api.order.js');
|
|
|
|
require('api.search.js');
|
|
|
|
require('api.state.js');
|
|
|
|
require('api.static.js');
|
|
|
|
require('api.core.js');
|
2012-04-13 11:44:25 +02:00
|
|
|
|
2011-12-03 10:36:19 +01:00
|
|
|
/**
|
|
|
|
* Version string for plug-ins to check compatibility. Allowed format is
|
2012-10-28 17:39:35 +01:00
|
|
|
* `a.b.c-d` where: a:int, b:int, c:int, d:string(dev|beta|alpha). `d` is used
|
|
|
|
* only for non-release builds. See http://semver.org/ for more information.
|
2011-12-09 09:33:45 +01:00
|
|
|
* @member
|
2011-12-03 10:36:19 +01:00
|
|
|
* @type string
|
|
|
|
* @default Version number
|
|
|
|
*/
|
2015-09-07 16:54:09 +02:00
|
|
|
DataTable.version = "1.10.10-dev";
|
2011-12-03 10:36:19 +01:00
|
|
|
|
2011-12-06 19:03:29 +01:00
|
|
|
/**
|
2013-02-05 10:36:58 +01:00
|
|
|
* Private data store, containing all of the settings objects that are
|
|
|
|
* created for the tables on a given page.
|
|
|
|
*
|
|
|
|
* Note that the `DataTable.settings` object is aliased to
|
|
|
|
* `jQuery.fn.dataTableExt` through which it may be accessed and
|
|
|
|
* manipulated, or `jQuery.fn.dataTable.settings`.
|
2011-12-09 09:33:45 +01:00
|
|
|
* @member
|
2011-12-06 19:03:29 +01:00
|
|
|
* @type array
|
|
|
|
* @default []
|
|
|
|
* @private
|
|
|
|
*/
|
|
|
|
DataTable.settings = [];
|
|
|
|
|
|
|
|
/**
|
2013-02-05 10:36:58 +01:00
|
|
|
* Object models container, for the various models that DataTables has
|
|
|
|
* available to it. These models define the objects that are used to hold
|
|
|
|
* the active state and configuration of the table.
|
2011-12-06 19:03:29 +01:00
|
|
|
* @namespace
|
|
|
|
*/
|
2011-11-25 18:08:21 +01:00
|
|
|
DataTable.models = {};
|
2015-10-13 16:26:36 +02:00
|
|
|
require('model.search.js');
|
|
|
|
require('model.row.js');
|
|
|
|
require('model.column.js');
|
|
|
|
require('model.defaults.js');
|
|
|
|
require('model.defaults.columns.js');
|
|
|
|
require('model.settings.js');
|
2011-12-03 10:36:19 +01:00
|
|
|
|
2011-12-06 19:03:29 +01:00
|
|
|
/**
|
2013-02-05 10:36:58 +01:00
|
|
|
* Extension object for DataTables that is used to provide all extension
|
|
|
|
* options.
|
|
|
|
*
|
|
|
|
* Note that the `DataTable.ext` object is available through
|
|
|
|
* `jQuery.fn.dataTable.ext` where it may be accessed and manipulated. It is
|
|
|
|
* also aliased to `jQuery.fn.dataTableExt` for historic reasons.
|
2011-12-06 19:03:29 +01:00
|
|
|
* @namespace
|
2012-02-01 10:07:52 +01:00
|
|
|
* @extends DataTable.models.ext
|
2011-12-06 19:03:29 +01:00
|
|
|
*/
|
2015-10-13 16:26:36 +02:00
|
|
|
require('ext.js');
|
|
|
|
require('ext.classes.js');
|
|
|
|
require('ext.paging.js');
|
|
|
|
require('ext.types.js');
|
|
|
|
require('ext.filter.js');
|
|
|
|
require('ext.sorting.js');
|
|
|
|
require('ext.renderer.js');
|
|
|
|
require('ext.helpers.js');
|
|
|
|
require('api.internal.js');
|
2011-11-24 15:05:22 +01:00
|
|
|
|
2013-11-29 12:59:43 +01:00
|
|
|
// jQuery access
|
2011-11-24 15:05:22 +01:00
|
|
|
$.fn.dataTable = DataTable;
|
2013-11-29 12:59:43 +01:00
|
|
|
|
|
|
|
// Legacy aliases
|
|
|
|
$.fn.dataTableSettings = DataTable.settings;
|
|
|
|
$.fn.dataTableExt = DataTable.ext;
|
|
|
|
|
|
|
|
// With a capital `D` we return a DataTables API instance rather than a
|
|
|
|
// jQuery object
|
2013-04-16 17:38:53 +02:00
|
|
|
$.fn.DataTable = function ( opts ) {
|
|
|
|
return $(this).dataTable( opts ).api();
|
|
|
|
};
|
2013-11-29 12:59:43 +01:00
|
|
|
|
|
|
|
// All properties that are available to $.fn.dataTable should also be
|
|
|
|
// available on $.fn.DataTable
|
|
|
|
$.each( DataTable, function ( prop, val ) {
|
|
|
|
$.fn.DataTable[ prop ] = val;
|
|
|
|
} );
|
2011-11-24 15:05:22 +01:00
|
|
|
|
2011-12-07 11:24:03 +01:00
|
|
|
|
|
|
|
// Information about events fired by DataTables - for documentation.
|
|
|
|
/**
|
2013-02-05 10:36:58 +01:00
|
|
|
* 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.
|
New: DataTables events are now all bound to the `.dt` namespace
- This is a breaking backwards incompatible change - please be aware of
this!
- DataTables fires custom events such as `draw` etc, but these events
were in no way identifyable as eminating from DataTables rather than
some other component, which can cause confusion and difficulty
resolving bugs.
- As such, all DataTables events are now fired with the `dt` namespace -
this means if you are currently using events, you must update your
code to also use the .dt namespace. If you are already using
namespaces, that's great, you can continue to do so as jQuery allows
multiple namespaces, but you must still use the .dt namespace.
- This is a breaking change because the old behaviour was incorrect -
i.e. this was a bug to be fixed, hence why we haven't gone through a
deprecation cycle. The old events weren't well documented (only in the
JSDoc generated docs and a few of my forum posts), whereas in 1.10
they will form a key part of the documentation. As such, now is the
time to get this right. This will be documented clearly in the upgrade
notes.
- Discussion on this topic here:
https://github.com/DataTables/DataTables/issues/245
2013-11-18 12:45:41 +01:00
|
|
|
* @name DataTable#draw.dt
|
2011-12-07 11:24:03 +01:00
|
|
|
* @event
|
|
|
|
* @param {event} e jQuery event object
|
|
|
|
* @param {object} o DataTables settings object {@link DataTable.models.oSettings}
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2013-11-12 20:18:40 +01:00
|
|
|
* Search event, fired when the searching applied to the table (using the
|
|
|
|
* built-in global search, or column filters) is altered.
|
New: DataTables events are now all bound to the `.dt` namespace
- This is a breaking backwards incompatible change - please be aware of
this!
- DataTables fires custom events such as `draw` etc, but these events
were in no way identifyable as eminating from DataTables rather than
some other component, which can cause confusion and difficulty
resolving bugs.
- As such, all DataTables events are now fired with the `dt` namespace -
this means if you are currently using events, you must update your
code to also use the .dt namespace. If you are already using
namespaces, that's great, you can continue to do so as jQuery allows
multiple namespaces, but you must still use the .dt namespace.
- This is a breaking change because the old behaviour was incorrect -
i.e. this was a bug to be fixed, hence why we haven't gone through a
deprecation cycle. The old events weren't well documented (only in the
JSDoc generated docs and a few of my forum posts), whereas in 1.10
they will form a key part of the documentation. As such, now is the
time to get this right. This will be documented clearly in the upgrade
notes.
- Discussion on this topic here:
https://github.com/DataTables/DataTables/issues/245
2013-11-18 12:45:41 +01:00
|
|
|
* @name DataTable#search.dt
|
2011-12-07 11:24:03 +01:00
|
|
|
* @event
|
|
|
|
* @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.
|
New: DataTables events are now all bound to the `.dt` namespace
- This is a breaking backwards incompatible change - please be aware of
this!
- DataTables fires custom events such as `draw` etc, but these events
were in no way identifyable as eminating from DataTables rather than
some other component, which can cause confusion and difficulty
resolving bugs.
- As such, all DataTables events are now fired with the `dt` namespace -
this means if you are currently using events, you must update your
code to also use the .dt namespace. If you are already using
namespaces, that's great, you can continue to do so as jQuery allows
multiple namespaces, but you must still use the .dt namespace.
- This is a breaking change because the old behaviour was incorrect -
i.e. this was a bug to be fixed, hence why we haven't gone through a
deprecation cycle. The old events weren't well documented (only in the
JSDoc generated docs and a few of my forum posts), whereas in 1.10
they will form a key part of the documentation. As such, now is the
time to get this right. This will be documented clearly in the upgrade
notes.
- Discussion on this topic here:
https://github.com/DataTables/DataTables/issues/245
2013-11-18 12:45:41 +01:00
|
|
|
* @name DataTable#page.dt
|
2011-12-07 11:24:03 +01:00
|
|
|
* @event
|
|
|
|
* @param {event} e jQuery event object
|
|
|
|
* @param {object} o DataTables settings object {@link DataTable.models.oSettings}
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2013-11-12 20:18:40 +01:00
|
|
|
* Order event, fired when the ordering applied to the table is altered.
|
New: DataTables events are now all bound to the `.dt` namespace
- This is a breaking backwards incompatible change - please be aware of
this!
- DataTables fires custom events such as `draw` etc, but these events
were in no way identifyable as eminating from DataTables rather than
some other component, which can cause confusion and difficulty
resolving bugs.
- As such, all DataTables events are now fired with the `dt` namespace -
this means if you are currently using events, you must update your
code to also use the .dt namespace. If you are already using
namespaces, that's great, you can continue to do so as jQuery allows
multiple namespaces, but you must still use the .dt namespace.
- This is a breaking change because the old behaviour was incorrect -
i.e. this was a bug to be fixed, hence why we haven't gone through a
deprecation cycle. The old events weren't well documented (only in the
JSDoc generated docs and a few of my forum posts), whereas in 1.10
they will form a key part of the documentation. As such, now is the
time to get this right. This will be documented clearly in the upgrade
notes.
- Discussion on this topic here:
https://github.com/DataTables/DataTables/issues/245
2013-11-18 12:45:41 +01:00
|
|
|
* @name DataTable#order.dt
|
2011-12-07 11:24:03 +01:00
|
|
|
* @event
|
|
|
|
* @param {event} e jQuery event object
|
|
|
|
* @param {object} o DataTables settings object {@link DataTable.models.oSettings}
|
|
|
|
*/
|
|
|
|
|
2011-12-27 14:02:18 +01:00
|
|
|
/**
|
2013-02-05 10:36:58 +01:00
|
|
|
* DataTables initialisation complete event, fired when the table is fully
|
|
|
|
* drawn, including Ajax data loaded, if Ajax data is required.
|
New: DataTables events are now all bound to the `.dt` namespace
- This is a breaking backwards incompatible change - please be aware of
this!
- DataTables fires custom events such as `draw` etc, but these events
were in no way identifyable as eminating from DataTables rather than
some other component, which can cause confusion and difficulty
resolving bugs.
- As such, all DataTables events are now fired with the `dt` namespace -
this means if you are currently using events, you must update your
code to also use the .dt namespace. If you are already using
namespaces, that's great, you can continue to do so as jQuery allows
multiple namespaces, but you must still use the .dt namespace.
- This is a breaking change because the old behaviour was incorrect -
i.e. this was a bug to be fixed, hence why we haven't gone through a
deprecation cycle. The old events weren't well documented (only in the
JSDoc generated docs and a few of my forum posts), whereas in 1.10
they will form a key part of the documentation. As such, now is the
time to get this right. This will be documented clearly in the upgrade
notes.
- Discussion on this topic here:
https://github.com/DataTables/DataTables/issues/245
2013-11-18 12:45:41 +01:00
|
|
|
* @name DataTable#init.dt
|
2011-12-27 14:02:18 +01:00
|
|
|
* @event
|
|
|
|
* @param {event} e jQuery event object
|
|
|
|
* @param {object} oSettings DataTables settings object
|
|
|
|
* @param {object} json The JSON object request from the server - only
|
|
|
|
* present if client-side Ajax sourced data is used</li></ol>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2013-02-05 10:36:58 +01:00
|
|
|
* State save event, fired when the table has changed state a new state save
|
2013-11-12 20:18:18 +01:00
|
|
|
* is required. This event allows modification of the state saving object
|
2013-02-05 10:36:58 +01:00
|
|
|
* prior to actually doing the save, including addition or other state
|
|
|
|
* properties (for plug-ins) or modification of a DataTables core property.
|
New: DataTables events are now all bound to the `.dt` namespace
- This is a breaking backwards incompatible change - please be aware of
this!
- DataTables fires custom events such as `draw` etc, but these events
were in no way identifyable as eminating from DataTables rather than
some other component, which can cause confusion and difficulty
resolving bugs.
- As such, all DataTables events are now fired with the `dt` namespace -
this means if you are currently using events, you must update your
code to also use the .dt namespace. If you are already using
namespaces, that's great, you can continue to do so as jQuery allows
multiple namespaces, but you must still use the .dt namespace.
- This is a breaking change because the old behaviour was incorrect -
i.e. this was a bug to be fixed, hence why we haven't gone through a
deprecation cycle. The old events weren't well documented (only in the
JSDoc generated docs and a few of my forum posts), whereas in 1.10
they will form a key part of the documentation. As such, now is the
time to get this right. This will be documented clearly in the upgrade
notes.
- Discussion on this topic here:
https://github.com/DataTables/DataTables/issues/245
2013-11-18 12:45:41 +01:00
|
|
|
* @name DataTable#stateSaveParams.dt
|
2012-01-02 11:12:39 +01:00
|
|
|
* @event
|
|
|
|
* @param {event} e jQuery event object
|
|
|
|
* @param {object} oSettings DataTables settings object
|
|
|
|
* @param {object} json The state information to be saved
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2013-02-05 10:36:58 +01:00
|
|
|
* State load event, fired when the table is loading state from the stored
|
|
|
|
* data, but prior to the settings object being modified by the saved state
|
|
|
|
* - allowing modification of the saved state is required or loading of
|
|
|
|
* state for a plug-in.
|
New: DataTables events are now all bound to the `.dt` namespace
- This is a breaking backwards incompatible change - please be aware of
this!
- DataTables fires custom events such as `draw` etc, but these events
were in no way identifyable as eminating from DataTables rather than
some other component, which can cause confusion and difficulty
resolving bugs.
- As such, all DataTables events are now fired with the `dt` namespace -
this means if you are currently using events, you must update your
code to also use the .dt namespace. If you are already using
namespaces, that's great, you can continue to do so as jQuery allows
multiple namespaces, but you must still use the .dt namespace.
- This is a breaking change because the old behaviour was incorrect -
i.e. this was a bug to be fixed, hence why we haven't gone through a
deprecation cycle. The old events weren't well documented (only in the
JSDoc generated docs and a few of my forum posts), whereas in 1.10
they will form a key part of the documentation. As such, now is the
time to get this right. This will be documented clearly in the upgrade
notes.
- Discussion on this topic here:
https://github.com/DataTables/DataTables/issues/245
2013-11-18 12:45:41 +01:00
|
|
|
* @name DataTable#stateLoadParams.dt
|
2012-01-02 11:12:39 +01:00
|
|
|
* @event
|
|
|
|
* @param {event} e jQuery event object
|
|
|
|
* @param {object} oSettings DataTables settings object
|
|
|
|
* @param {object} json The saved state information
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2013-02-05 10:36:58 +01:00
|
|
|
* State loaded event, fired when state has been loaded from stored data and
|
|
|
|
* the settings object has been modified by the loaded data.
|
New: DataTables events are now all bound to the `.dt` namespace
- This is a breaking backwards incompatible change - please be aware of
this!
- DataTables fires custom events such as `draw` etc, but these events
were in no way identifyable as eminating from DataTables rather than
some other component, which can cause confusion and difficulty
resolving bugs.
- As such, all DataTables events are now fired with the `dt` namespace -
this means if you are currently using events, you must update your
code to also use the .dt namespace. If you are already using
namespaces, that's great, you can continue to do so as jQuery allows
multiple namespaces, but you must still use the .dt namespace.
- This is a breaking change because the old behaviour was incorrect -
i.e. this was a bug to be fixed, hence why we haven't gone through a
deprecation cycle. The old events weren't well documented (only in the
JSDoc generated docs and a few of my forum posts), whereas in 1.10
they will form a key part of the documentation. As such, now is the
time to get this right. This will be documented clearly in the upgrade
notes.
- Discussion on this topic here:
https://github.com/DataTables/DataTables/issues/245
2013-11-18 12:45:41 +01:00
|
|
|
* @name DataTable#stateLoaded.dt
|
2011-12-27 14:02:18 +01:00
|
|
|
* @event
|
|
|
|
* @param {event} e jQuery event object
|
|
|
|
* @param {object} oSettings DataTables settings object
|
2012-01-02 11:12:39 +01:00
|
|
|
* @param {object} json The saved state information
|
2011-12-27 14:02:18 +01:00
|
|
|
*/
|
|
|
|
|
2011-12-27 19:37:28 +01:00
|
|
|
/**
|
2013-02-05 10:36:58 +01:00
|
|
|
* Processing event, fired when DataTables is doing some kind of processing
|
2013-11-12 20:18:40 +01:00
|
|
|
* (be it, order, searcg or anything else). It can be used to indicate to
|
|
|
|
* the end user that there is something happening, or that something has
|
2013-02-05 10:36:58 +01:00
|
|
|
* finished.
|
New: DataTables events are now all bound to the `.dt` namespace
- This is a breaking backwards incompatible change - please be aware of
this!
- DataTables fires custom events such as `draw` etc, but these events
were in no way identifyable as eminating from DataTables rather than
some other component, which can cause confusion and difficulty
resolving bugs.
- As such, all DataTables events are now fired with the `dt` namespace -
this means if you are currently using events, you must update your
code to also use the .dt namespace. If you are already using
namespaces, that's great, you can continue to do so as jQuery allows
multiple namespaces, but you must still use the .dt namespace.
- This is a breaking change because the old behaviour was incorrect -
i.e. this was a bug to be fixed, hence why we haven't gone through a
deprecation cycle. The old events weren't well documented (only in the
JSDoc generated docs and a few of my forum posts), whereas in 1.10
they will form a key part of the documentation. As such, now is the
time to get this right. This will be documented clearly in the upgrade
notes.
- Discussion on this topic here:
https://github.com/DataTables/DataTables/issues/245
2013-11-18 12:45:41 +01:00
|
|
|
* @name DataTable#processing.dt
|
2011-12-27 19:37:28 +01:00
|
|
|
* @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
|
|
|
|
*/
|
|
|
|
|
2011-12-07 11:24:03 +01:00
|
|
|
/**
|
2013-02-05 10:31:48 +01:00
|
|
|
* Ajax (XHR) event, fired whenever an Ajax request is completed from a
|
|
|
|
* request to made to the server for new data. This event is called before
|
|
|
|
* DataTables processed the returned data, so it can also be used to pre-
|
|
|
|
* process the data returned from the server, if needed.
|
|
|
|
*
|
|
|
|
* 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.
|
New: DataTables events are now all bound to the `.dt` namespace
- This is a breaking backwards incompatible change - please be aware of
this!
- DataTables fires custom events such as `draw` etc, but these events
were in no way identifyable as eminating from DataTables rather than
some other component, which can cause confusion and difficulty
resolving bugs.
- As such, all DataTables events are now fired with the `dt` namespace -
this means if you are currently using events, you must update your
code to also use the .dt namespace. If you are already using
namespaces, that's great, you can continue to do so as jQuery allows
multiple namespaces, but you must still use the .dt namespace.
- This is a breaking change because the old behaviour was incorrect -
i.e. this was a bug to be fixed, hence why we haven't gone through a
deprecation cycle. The old events weren't well documented (only in the
JSDoc generated docs and a few of my forum posts), whereas in 1.10
they will form a key part of the documentation. As such, now is the
time to get this right. This will be documented clearly in the upgrade
notes.
- Discussion on this topic here:
https://github.com/DataTables/DataTables/issues/245
2013-11-18 12:45:41 +01:00
|
|
|
* @name DataTable#xhr.dt
|
2011-12-07 11:24:03 +01:00
|
|
|
* @event
|
|
|
|
* @param {event} e jQuery event object
|
|
|
|
* @param {object} o DataTables settings object {@link DataTable.models.oSettings}
|
2012-08-08 17:29:27 +02:00
|
|
|
* @param {object} json JSON returned from the server
|
2013-02-05 10:31:48 +01:00
|
|
|
*
|
|
|
|
* @example
|
|
|
|
* // Use a custom property returned from the server in another DOM element
|
New: DataTables events are now all bound to the `.dt` namespace
- This is a breaking backwards incompatible change - please be aware of
this!
- DataTables fires custom events such as `draw` etc, but these events
were in no way identifyable as eminating from DataTables rather than
some other component, which can cause confusion and difficulty
resolving bugs.
- As such, all DataTables events are now fired with the `dt` namespace -
this means if you are currently using events, you must update your
code to also use the .dt namespace. If you are already using
namespaces, that's great, you can continue to do so as jQuery allows
multiple namespaces, but you must still use the .dt namespace.
- This is a breaking change because the old behaviour was incorrect -
i.e. this was a bug to be fixed, hence why we haven't gone through a
deprecation cycle. The old events weren't well documented (only in the
JSDoc generated docs and a few of my forum posts), whereas in 1.10
they will form a key part of the documentation. As such, now is the
time to get this right. This will be documented clearly in the upgrade
notes.
- Discussion on this topic here:
https://github.com/DataTables/DataTables/issues/245
2013-11-18 12:45:41 +01:00
|
|
|
* $('#table').dataTable().on('xhr.dt', function (e, settings, json) {
|
2013-02-05 10:31:48 +01:00
|
|
|
* $('#status').html( json.status );
|
|
|
|
* } );
|
|
|
|
*
|
|
|
|
* @example
|
|
|
|
* // Pre-process the data returned from the server
|
New: DataTables events are now all bound to the `.dt` namespace
- This is a breaking backwards incompatible change - please be aware of
this!
- DataTables fires custom events such as `draw` etc, but these events
were in no way identifyable as eminating from DataTables rather than
some other component, which can cause confusion and difficulty
resolving bugs.
- As such, all DataTables events are now fired with the `dt` namespace -
this means if you are currently using events, you must update your
code to also use the .dt namespace. If you are already using
namespaces, that's great, you can continue to do so as jQuery allows
multiple namespaces, but you must still use the .dt namespace.
- This is a breaking change because the old behaviour was incorrect -
i.e. this was a bug to be fixed, hence why we haven't gone through a
deprecation cycle. The old events weren't well documented (only in the
JSDoc generated docs and a few of my forum posts), whereas in 1.10
they will form a key part of the documentation. As such, now is the
time to get this right. This will be documented clearly in the upgrade
notes.
- Discussion on this topic here:
https://github.com/DataTables/DataTables/issues/245
2013-11-18 12:45:41 +01:00
|
|
|
* $('#table').dataTable().on('xhr.dt', function (e, settings, json) {
|
2013-02-05 10:31:48 +01:00
|
|
|
* for ( var i=0, ien=json.aaData.length ; i<ien ; i++ ) {
|
|
|
|
* json.aaData[i].sum = json.aaData[i].one + json.aaData[i].two;
|
|
|
|
* }
|
|
|
|
* // Note no return - manipulate the data directly in the JSON object.
|
|
|
|
* } );
|
2011-12-07 11:24:03 +01:00
|
|
|
*/
|
2012-04-13 16:26:30 +02:00
|
|
|
|
|
|
|
/**
|
2013-02-05 10:36:58 +01:00
|
|
|
* Destroy event, fired when the DataTable is destroyed by calling fnDestroy
|
|
|
|
* or passing the bDestroy:true parameter in the initialisation object. This
|
|
|
|
* can be used to remove bound events, added DOM nodes, etc.
|
New: DataTables events are now all bound to the `.dt` namespace
- This is a breaking backwards incompatible change - please be aware of
this!
- DataTables fires custom events such as `draw` etc, but these events
were in no way identifyable as eminating from DataTables rather than
some other component, which can cause confusion and difficulty
resolving bugs.
- As such, all DataTables events are now fired with the `dt` namespace -
this means if you are currently using events, you must update your
code to also use the .dt namespace. If you are already using
namespaces, that's great, you can continue to do so as jQuery allows
multiple namespaces, but you must still use the .dt namespace.
- This is a breaking change because the old behaviour was incorrect -
i.e. this was a bug to be fixed, hence why we haven't gone through a
deprecation cycle. The old events weren't well documented (only in the
JSDoc generated docs and a few of my forum posts), whereas in 1.10
they will form a key part of the documentation. As such, now is the
time to get this right. This will be documented clearly in the upgrade
notes.
- Discussion on this topic here:
https://github.com/DataTables/DataTables/issues/245
2013-11-18 12:45:41 +01:00
|
|
|
* @name DataTable#destroy.dt
|
2012-04-13 16:26:30 +02:00
|
|
|
* @event
|
|
|
|
* @param {event} e jQuery event object
|
|
|
|
* @param {object} o DataTables settings object {@link DataTable.models.oSettings}
|
|
|
|
*/
|
2013-04-18 08:49:38 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Page length change event, fired when number of records to show on each
|
|
|
|
* page (the length) is changed.
|
New: DataTables events are now all bound to the `.dt` namespace
- This is a breaking backwards incompatible change - please be aware of
this!
- DataTables fires custom events such as `draw` etc, but these events
were in no way identifyable as eminating from DataTables rather than
some other component, which can cause confusion and difficulty
resolving bugs.
- As such, all DataTables events are now fired with the `dt` namespace -
this means if you are currently using events, you must update your
code to also use the .dt namespace. If you are already using
namespaces, that's great, you can continue to do so as jQuery allows
multiple namespaces, but you must still use the .dt namespace.
- This is a breaking change because the old behaviour was incorrect -
i.e. this was a bug to be fixed, hence why we haven't gone through a
deprecation cycle. The old events weren't well documented (only in the
JSDoc generated docs and a few of my forum posts), whereas in 1.10
they will form a key part of the documentation. As such, now is the
time to get this right. This will be documented clearly in the upgrade
notes.
- Discussion on this topic here:
https://github.com/DataTables/DataTables/issues/245
2013-11-18 12:45:41 +01:00
|
|
|
* @name DataTable#length.dt
|
2013-04-18 08:49:38 +02:00
|
|
|
* @event
|
|
|
|
* @param {event} e jQuery event object
|
|
|
|
* @param {object} o DataTables settings object {@link DataTable.models.oSettings}
|
|
|
|
* @param {integer} len New length
|
|
|
|
*/
|
2013-08-06 11:26:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Column sizing has changed.
|
New: DataTables events are now all bound to the `.dt` namespace
- This is a breaking backwards incompatible change - please be aware of
this!
- DataTables fires custom events such as `draw` etc, but these events
were in no way identifyable as eminating from DataTables rather than
some other component, which can cause confusion and difficulty
resolving bugs.
- As such, all DataTables events are now fired with the `dt` namespace -
this means if you are currently using events, you must update your
code to also use the .dt namespace. If you are already using
namespaces, that's great, you can continue to do so as jQuery allows
multiple namespaces, but you must still use the .dt namespace.
- This is a breaking change because the old behaviour was incorrect -
i.e. this was a bug to be fixed, hence why we haven't gone through a
deprecation cycle. The old events weren't well documented (only in the
JSDoc generated docs and a few of my forum posts), whereas in 1.10
they will form a key part of the documentation. As such, now is the
time to get this right. This will be documented clearly in the upgrade
notes.
- Discussion on this topic here:
https://github.com/DataTables/DataTables/issues/245
2013-11-18 12:45:41 +01:00
|
|
|
* @name DataTable#column-sizing.dt
|
2013-08-06 11:26:05 +02:00
|
|
|
* @event
|
|
|
|
* @param {event} e jQuery event object
|
|
|
|
* @param {object} o DataTables settings object {@link DataTable.models.oSettings}
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2013-11-12 20:18:18 +01:00
|
|
|
* Column visibility has changed.
|
New: DataTables events are now all bound to the `.dt` namespace
- This is a breaking backwards incompatible change - please be aware of
this!
- DataTables fires custom events such as `draw` etc, but these events
were in no way identifyable as eminating from DataTables rather than
some other component, which can cause confusion and difficulty
resolving bugs.
- As such, all DataTables events are now fired with the `dt` namespace -
this means if you are currently using events, you must update your
code to also use the .dt namespace. If you are already using
namespaces, that's great, you can continue to do so as jQuery allows
multiple namespaces, but you must still use the .dt namespace.
- This is a breaking change because the old behaviour was incorrect -
i.e. this was a bug to be fixed, hence why we haven't gone through a
deprecation cycle. The old events weren't well documented (only in the
JSDoc generated docs and a few of my forum posts), whereas in 1.10
they will form a key part of the documentation. As such, now is the
time to get this right. This will be documented clearly in the upgrade
notes.
- Discussion on this topic here:
https://github.com/DataTables/DataTables/issues/245
2013-11-18 12:45:41 +01:00
|
|
|
* @name DataTable#column-visibility.dt
|
2013-08-06 11:26:05 +02:00
|
|
|
* @event
|
|
|
|
* @param {event} e jQuery event object
|
|
|
|
* @param {object} o DataTables settings object {@link DataTable.models.oSettings}
|
|
|
|
* @param {int} column Column index
|
|
|
|
* @param {bool} vis `false` if column now hidden, or `true` if visible
|
|
|
|
*/
|
2014-01-22 11:14:07 +01:00
|
|
|
|
|
|
|
return $.fn.dataTable;
|
2012-09-02 11:33:49 +02:00
|
|
|
}));
|
|
|
|
|
2014-01-17 09:51:06 +01:00
|
|
|
}(window, document));
|
2012-09-02 11:33:49 +02:00
|
|
|
|